Skip to content

Commit

Permalink
[CodeBuild] fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MarleneKress79789 committed Dec 13, 2023
1 parent f302414 commit cb4dc19
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ def reset_mocks(self):

def test_init():
test_setup = TestSetup()
assert test_setup.temporary_directory_factory_mock.mock_calls == [call.create(), call.create().__enter__()] \
assert test_setup.temporary_directory_factory_mock.mock_calls == [call.create(),
call.create().__enter__(),
call.create().__enter__().__fspath__()] \
and test_setup.model_factory_mock.mock_calls == [] \
and test_setup.bucketfs_location_mock.mock_calls == [] \
and mock_cast(test_setup.bucketfs_model_uploader_factory_mock.create).mock_calls == [
Expand All @@ -60,10 +62,10 @@ def test_init():
def test_download_function_call():
test_setup = TestSetup()
test_setup.downloader.download_from_huggingface_hub(model_factory=test_setup.model_factory_mock)
cache_dir = test_setup.temporary_directory_factory_mock.create().__enter__().__truediv__()
cache_dir = test_setup.temporary_directory_factory_mock.create().__enter__()
model_save_path = (test_setup.downloader._tmpdir_name/"pretrained"/test_setup.model_name)
assert test_setup.model_factory_mock.mock_calls == [
call.from_pretrained(test_setup.model_name, cache_dir=cache_dir,
call.from_pretrained(test_setup.model_name, cache_dir=Path(cache_dir)/"cache",
use_auth_token=test_setup.token),
call.from_pretrained().save_pretrained(model_save_path)]

Expand Down

0 comments on commit cb4dc19

Please sign in to comment.