From 8fc714ff213e1e5ccf9b5e27fc8ed23f9caa9cc8 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Sat, 12 Dec 2020 01:30:47 +0000 Subject: [PATCH] Test retrieving doc from internet w/o local copy --- tests/test_discovery.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/test_discovery.py b/tests/test_discovery.py index fde24a6bd3d..f528bdf0c5c 100644 --- a/tests/test_discovery.py +++ b/tests/test_discovery.py @@ -1151,14 +1151,22 @@ def import_mock(name, *args, **kwargs): class DiscoveryFromStaticDocument(unittest.TestCase): def test_can_build_from_static_document_when_enabled(self): http = HttpMockSequence([({"status": "400"}, "")]) - drive = build("drive", "v3", http=http, cache_discovery=False, static_discovery=True) + drive = build("drive", "v3", http=http, cache_discovery=False, + static_discovery=True) self.assertIsNotNone(drive) self.assertTrue(hasattr(drive, "files")) def test_disable_build_from_static_document(self): http = HttpMockSequence([({"status": "400"}, "")]) with self.assertRaises(HttpError): - build("drive", "v3", http=http, cache_discovery=False, static_discovery=False) + build("drive", "v3", http=http, cache_discovery=False, + static_discovery=False) + + def test_retrieve_from_internet_when_static_doc_does_not_exist(self): + http = HttpMockSequence([({"status": "400"}, "")]) + with self.assertRaises(HttpError): + build("doesnotexist", "v3", http=http, cache_discovery=False, + static_discovery=True) class DictCache(Cache):