Skip to content

Commit a79c081

Browse files
committed
final test
1 parent c5334ed commit a79c081

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

mergin/test/test_client.py

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2713,35 +2713,25 @@ def test_error_projects_limit_hit(mcStorage: MerginClient):
27132713
assert e.value.url == f"{mcStorage.url}v1/project/testpluginstorage"
27142714

27152715

2716-
def test_error_monthly_contributors_limit_hit(mcStorage: MerginClient):
2717-
test_project = "test_another_project_above_monthly_contributors_limit_hit"
2718-
test_project_fullname = STORAGE_WORKSPACE + "/" + test_project
2716+
def test_error_monthly_contributors_limit_hit(mc: MerginClient):
2717+
test_project = "test_project_monthly_contributors_limit_hit"
2718+
test_project_fullname = API_USER + "/" + test_project
27192719

27202720
client_workspace = None
2721-
for workspace in mcStorage.workspaces_list():
2722-
if workspace["name"] == STORAGE_WORKSPACE:
2721+
for workspace in mc.workspaces_list():
2722+
if workspace["name"] == API_USER:
27232723
client_workspace = workspace
27242724
break
27252725

27262726
client_workspace_id = client_workspace["id"]
2727-
client_workspace_storage = client_workspace["storage"]
2728-
mcStorage.patch(
2727+
mc.patch(
27292728
f"/v1/tests/workspaces/{client_workspace_id}",
2730-
{
2731-
"limits_override": {
2732-
"storage": client_workspace_storage,
2733-
"monthly_contributors": 0,
2734-
"projects": 5,
2735-
"api_allowed": True,
2736-
}
2737-
},
2729+
{"limits_override": {"monthly_contributors": 0}},
27382730
{"Content-Type": "application/json"},
27392731
)
27402732

2741-
project_dir = os.path.join(TMP_DIR, test_project, API_USER)
2742-
27432733
with pytest.raises(ClientError) as e:
2744-
mcStorage.create_project_and_push(test_project_fullname, project_dir)
2734+
mc.create_project(test_project_fullname)
27452735

27462736
assert e.value.server_code == ErrorCode.MonthlyContributorsLimitHit.value
27472737
assert e.value.detail == (
@@ -2750,5 +2740,5 @@ def test_error_monthly_contributors_limit_hit(mcStorage: MerginClient):
27502740
)
27512741
assert e.value.http_error == 422
27522742
assert e.value.http_method == "POST"
2753-
assert e.value.url == f"{mcStorage.url}v1/project/{STORAGE_WORKSPACE}"
2743+
assert e.value.url == f"{mcStorage.url}v1/project/{API_USER}"
27542744
assert e.value.contributors_quota == 0

0 commit comments

Comments
 (0)