@@ -1151,14 +1151,22 @@ def import_mock(name, *args, **kwargs):
1151
1151
class DiscoveryFromStaticDocument (unittest .TestCase ):
1152
1152
def test_can_build_from_static_document_when_enabled (self ):
1153
1153
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 )
1155
1156
self .assertIsNotNone (drive )
1156
1157
self .assertTrue (hasattr (drive , "files" ))
1157
1158
1158
1159
def test_disable_build_from_static_document (self ):
1159
1160
http = HttpMockSequence ([({"status" : "400" }, "" )])
1160
1161
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 )
1162
1170
1163
1171
1164
1172
class DictCache (Cache ):
0 commit comments