File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -456,7 +456,7 @@ async def apply_metadata_json(self):
456
456
# step 2: database-level metadata
457
457
for dbname , db in self ._metadata_local .get ("databases" , {}).items ():
458
458
for key , value in db .items ():
459
- if key == "tables" :
459
+ if key in ( "tables" , "queries" ) :
460
460
continue
461
461
await self .set_database_metadata (dbname , key , value )
462
462
Original file line number Diff line number Diff line change @@ -173,3 +173,23 @@ async def test_get_permission(ds_client):
173
173
# And test KeyError
174
174
with pytest .raises (KeyError ):
175
175
ds .get_permission ("missing-permission" )
176
+
177
+
178
+ @pytest .mark .asyncio
179
+ async def test_apply_metadata_json ():
180
+ ds = Datasette (
181
+ metadata = {
182
+ "databases" : {
183
+ "legislators" : {
184
+ "tables" : {"offices" : {"summary" : "office address or sumtin" }},
185
+ "queries" : {
186
+ "millenntial_represetatives" : {
187
+ "summary" : "Social media accounts for current legislators"
188
+ }
189
+ },
190
+ }
191
+ }
192
+ },
193
+ )
194
+ await ds .invoke_startup ()
195
+ assert (await ds .client .get ("/" )).status_code == 200
You can’t perform that action at this time.
0 commit comments