From cb4dc19626d689c0bd822662585d66f18e301417 Mon Sep 17 00:00:00 2001 From: MarleneKress79789 Date: Wed, 13 Dec 2023 14:12:55 +0100 Subject: [PATCH] [CodeBuild] fix tests --- .../test_huggingface_hub_bucketfs_model_transfer_sp.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/unit_tests/utils/test_huggingface_hub_bucketfs_model_transfer_sp.py b/tests/unit_tests/utils/test_huggingface_hub_bucketfs_model_transfer_sp.py index 009a03ac..5b5814f8 100644 --- a/tests/unit_tests/utils/test_huggingface_hub_bucketfs_model_transfer_sp.py +++ b/tests/unit_tests/utils/test_huggingface_hub_bucketfs_model_transfer_sp.py @@ -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 == [ @@ -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)]