Skip to content

Commit 8fc714f

Browse files
committed
Test retrieving doc from internet w/o local copy
1 parent 7a8466c commit 8fc714f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/test_discovery.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,14 +1151,22 @@ def import_mock(name, *args, **kwargs):
11511151
class DiscoveryFromStaticDocument(unittest.TestCase):
11521152
def test_can_build_from_static_document_when_enabled(self):
11531153
http = HttpMockSequence([({"status": "400"}, "")])
1154-
drive = build("drive", "v3", http=http, cache_discovery=False, static_discovery=True)
1154+
drive = build("drive", "v3", http=http, cache_discovery=False,
1155+
static_discovery=True)
11551156
self.assertIsNotNone(drive)
11561157
self.assertTrue(hasattr(drive, "files"))
11571158

11581159
def test_disable_build_from_static_document(self):
11591160
http = HttpMockSequence([({"status": "400"}, "")])
11601161
with self.assertRaises(HttpError):
1161-
build("drive", "v3", http=http, cache_discovery=False, static_discovery=False)
1162+
build("drive", "v3", http=http, cache_discovery=False,
1163+
static_discovery=False)
1164+
1165+
def test_retrieve_from_internet_when_static_doc_does_not_exist(self):
1166+
http = HttpMockSequence([({"status": "400"}, "")])
1167+
with self.assertRaises(HttpError):
1168+
build("doesnotexist", "v3", http=http, cache_discovery=False,
1169+
static_discovery=True)
11621170

11631171

11641172
class DictCache(Cache):

0 commit comments

Comments
 (0)