Skip to content

Commit e453db6

Browse files
committed
fix: test_remove_invalid_tag_from_model exception
1 parent b8a4305 commit e453db6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/test_models.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
DatasetItem,
1010
Model,
1111
ModelRun,
12+
NucleusAPIError,
1213
NucleusClient,
1314
UploadResponse,
1415
)
@@ -143,9 +144,10 @@ def test_remove_invalid_tag_from_model(CLIENT, dataset: Dataset):
143144

144145
model.add_tags(["single tag"])
145146

146-
response = model.remove_tags(["tag_a"])
147-
assert "error" in response
147+
with pytest.raises(NucleusAPIError) as e_info:
148+
model.remove_tags(["tag_a"])
149+
assert e_info.value.status_code == 400
148150
assert (
149-
response["error"]
150-
== "Deleted 0 tags from model. Either the tag(s) did not exist, or you are not the owner of this model project."
151+
'{"error":"Deleted 0 tags from model. The specified tag(s) were not found."}'
152+
in e_info.value.message
151153
)

0 commit comments

Comments
 (0)