@@ -40,15 +40,15 @@ def _make_reference(session: Session, asset: Asset, name: str = "test", owner_id
4040
4141class TestEnsureTagsExist :
4242 def test_creates_new_tags (self , session : Session ):
43- ensure_tags_exist (session , ["alpha" , "beta" ], tag_type = "user" )
43+ ensure_tags_exist (session , ["alpha" , "beta" ])
4444 session .commit ()
4545
4646 tags = session .query (Tag ).all ()
4747 assert {t .name for t in tags } == {"alpha" , "beta" }
4848
4949 def test_is_idempotent (self , session : Session ):
50- ensure_tags_exist (session , ["alpha" ], tag_type = "user" )
51- ensure_tags_exist (session , ["alpha" ], tag_type = "user" )
50+ ensure_tags_exist (session , ["alpha" ])
51+ ensure_tags_exist (session , ["alpha" ])
5252 session .commit ()
5353
5454 assert session .query (Tag ).count () == 1
@@ -65,13 +65,6 @@ def test_empty_list_is_noop(self, session: Session):
6565 session .commit ()
6666 assert session .query (Tag ).count () == 0
6767
68- def test_tag_type_is_set (self , session : Session ):
69- ensure_tags_exist (session , ["system-tag" ], tag_type = "system" )
70- session .commit ()
71-
72- tag = session .query (Tag ).filter_by (name = "system-tag" ).one ()
73- assert tag .tag_type == "system"
74-
7568
7669class TestGetReferenceTags :
7770 def test_returns_empty_for_no_tags (self , session : Session ):
@@ -193,7 +186,7 @@ class TestMissingTagFunctions:
193186 def test_add_missing_tag_for_asset_id (self , session : Session ):
194187 asset = _make_asset (session , "hash1" )
195188 ref = _make_reference (session , asset )
196- ensure_tags_exist (session , ["missing" ], tag_type = "system" )
189+ ensure_tags_exist (session , ["missing" ])
197190
198191 add_missing_tag_for_asset_id (session , asset_id = asset .id )
199192 session .commit ()
@@ -204,7 +197,7 @@ def test_add_missing_tag_for_asset_id(self, session: Session):
204197 def test_add_missing_tag_is_idempotent (self , session : Session ):
205198 asset = _make_asset (session , "hash1" )
206199 ref = _make_reference (session , asset )
207- ensure_tags_exist (session , ["missing" ], tag_type = "system" )
200+ ensure_tags_exist (session , ["missing" ])
208201
209202 add_missing_tag_for_asset_id (session , asset_id = asset .id )
210203 add_missing_tag_for_asset_id (session , asset_id = asset .id )
@@ -216,7 +209,7 @@ def test_add_missing_tag_is_idempotent(self, session: Session):
216209 def test_remove_missing_tag_for_asset_id (self , session : Session ):
217210 asset = _make_asset (session , "hash1" )
218211 ref = _make_reference (session , asset )
219- ensure_tags_exist (session , ["missing" ], tag_type = "system" )
212+ ensure_tags_exist (session , ["missing" ])
220213 add_missing_tag_for_asset_id (session , asset_id = asset .id )
221214
222215 remove_missing_tag_for_asset_id (session , asset_id = asset .id )
@@ -237,7 +230,7 @@ def test_returns_tags_with_counts(self, session: Session):
237230
238231 rows , total = list_tags_with_usage (session )
239232
240- tag_dict = {name : count for name , _ , count in rows }
233+ tag_dict = {name : count for name , count in rows }
241234 assert tag_dict ["used" ] == 1
242235 assert tag_dict ["unused" ] == 0
243236 assert total == 2
@@ -252,7 +245,7 @@ def test_exclude_zero_counts(self, session: Session):
252245
253246 rows , total = list_tags_with_usage (session , include_zero = False )
254247
255- tag_names = {name for name , _ , _ in rows }
248+ tag_names = {name for name , _ in rows }
256249 assert "used" in tag_names
257250 assert "unused" not in tag_names
258251
@@ -262,7 +255,7 @@ def test_prefix_filter(self, session: Session):
262255
263256 rows , total = list_tags_with_usage (session , prefix = "alph" )
264257
265- tag_names = {name for name , _ , _ in rows }
258+ tag_names = {name for name , _ in rows }
266259 assert tag_names == {"alpha" , "alphabet" }
267260
268261 def test_order_by_name (self , session : Session ):
@@ -271,7 +264,7 @@ def test_order_by_name(self, session: Session):
271264
272265 rows , _ = list_tags_with_usage (session , order = "name_asc" )
273266
274- names = [name for name , _ , _ in rows ]
267+ names = [name for name , _ in rows ]
275268 assert names == ["alpha" , "middle" , "zebra" ]
276269
277270 def test_owner_visibility (self , session : Session ):
@@ -287,13 +280,13 @@ def test_owner_visibility(self, session: Session):
287280
288281 # Empty owner sees only shared
289282 rows , _ = list_tags_with_usage (session , owner_id = "" , include_zero = False )
290- tag_dict = {name : count for name , _ , count in rows }
283+ tag_dict = {name : count for name , count in rows }
291284 assert tag_dict .get ("shared-tag" , 0 ) == 1
292285 assert tag_dict .get ("owner-tag" , 0 ) == 0
293286
294287 # User1 sees both
295288 rows , _ = list_tags_with_usage (session , owner_id = "user1" , include_zero = False )
296- tag_dict = {name : count for name , _ , count in rows }
289+ tag_dict = {name : count for name , count in rows }
297290 assert tag_dict .get ("shared-tag" , 0 ) == 1
298291 assert tag_dict .get ("owner-tag" , 0 ) == 1
299292
0 commit comments