Unverified Commit 169b8cde authored by Lucain's avatar Lucain Committed by GitHub
Browse files

Fix mock in `test_cached_files_are_used_when_internet_is_down` (#18804)

parent 8b67f209
......@@ -349,6 +349,7 @@ class ConfigTestUtils(unittest.TestCase):
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.
_ = BertConfig.from_pretrained("hf-internal-testing/tiny-random-bert")
......
......@@ -172,6 +172,7 @@ class FeatureExtractorUtilTester(unittest.TestCase):
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.
_ = Wav2Vec2FeatureExtractor.from_pretrained("hf-internal-testing/tiny-random-wav2vec2")
......
......@@ -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")
......
......@@ -1924,6 +1924,7 @@ class UtilsFunctionsTest(unittest.TestCase):
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.
_ = TFBertModel.from_pretrained("hf-internal-testing/tiny-random-bert")
......
......@@ -3875,6 +3875,7 @@ class TokenizerUtilTester(unittest.TestCase):
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.
_ = BertTokenizer.from_pretrained("hf-internal-testing/tiny-random-bert")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment