Skip to content

Commit 3c2976d

Browse files
committed
Fix misuse of pytest library
1 parent 621c5ff commit 3c2976d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

mergin/test/test_client.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2639,10 +2639,10 @@ def test_error_push_already_named_project(mc: MerginClient):
26392639

26402640
with pytest.raises(ClientError) as e:
26412641
mc.create_project_and_push(test_project, project_dir)
2642-
assert e.detail == "Project with the same name already exists"
2643-
assert e.http_error == 409
2644-
assert e.http_method == "POST"
2645-
assert e.url == f"{mc.url}v1/project/test_plugin"
2642+
assert e.value.detail == "Project with the same name already exists"
2643+
assert e.value.http_error == 409
2644+
assert e.value.http_method == "POST"
2645+
assert e.value.url == f"{mc.url}v1/project/test_plugin"
26462646

26472647

26482648
def test_error_projects_limit_hit(mcStorage: MerginClient):
@@ -2653,11 +2653,11 @@ def test_error_projects_limit_hit(mcStorage: MerginClient):
26532653

26542654
with pytest.raises(ClientError) as e:
26552655
mcStorage.create_project_and_push(test_project_fullname, project_dir)
2656-
assert e.server_code == ErrorCode.ProjectsLimitHit.value
2656+
assert e.value.server_code == ErrorCode.ProjectsLimitHit.value
26572657
assert (
2658-
e.detail
2658+
e.value.detail
26592659
== "Maximum number of projects is reached. Please upgrade your subscription to create new projects (ProjectsLimitHit)"
26602660
)
2661-
assert e.http_error == 422
2662-
assert e.http_method == "POST"
2663-
assert e.url == "https://test.dev.merginmaps.com/v1/project/testpluginstorage"
2661+
assert e.value.http_error == 422
2662+
assert e.value.http_method == "POST"
2663+
assert e.value.url == f"{mcStorage.url}v1/project/testpluginstorage"

0 commit comments

Comments
 (0)