Fix mock in test_cached_files_are_used_when_internet_is_down (#18804)

This commit is contained in:
Lucain
2022-08-29 15:56:08 +02:00
committed by GitHub
parent 8b67f20935
commit 169b8cde47
5 changed files with 5 additions and 0 deletions

View File

@@ -2931,6 +2931,7 @@ class ModelUtilsTest(TestCasePlus):
response_mock.status_code = 500
response_mock.headers = {}
response_mock.raise_for_status.side_effect = HTTPError
response_mock.json.return_value = {}
# Download this model to make sure it's in the cache.
_ = BertModel.from_pretrained("hf-internal-testing/tiny-random-bert")