Skip to content

Commit fc35448

Browse files
committed
Add tests for retrieving static discovery docs
1 parent a186b80 commit fc35448

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/test_discovery.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,6 +1148,19 @@ def import_mock(name, *args, **kwargs):
11481148
)
11491149

11501150

1151+
class DiscoveryFromStaticDocument(unittest.TestCase):
1152+
def test_can_build_from_static_document_when_enabled(self):
1153+
http = HttpMockSequence([({"status": "400"}, "")])
1154+
drive = build("drive", "v3", http=http, cache_discovery=False, static_discovery=True)
1155+
self.assertIsNotNone(drive)
1156+
self.assertTrue(hasattr(drive, "files"))
1157+
1158+
def test_disable_build_from_static_document(self):
1159+
http = HttpMockSequence([({"status": "400"}, "")])
1160+
with self.assertRaises(HttpError):
1161+
build("drive", "v3", http=http, cache_discovery=False, static_discovery=False)
1162+
1163+
11511164
class DictCache(Cache):
11521165
def __init__(self):
11531166
self.d = {}

0 commit comments

Comments
 (0)