|
35 | 35 |
|
36 | 36 | @pytest.fixture(scope="function")
|
37 | 37 | def mc():
|
38 |
| - return create_client(API_USER, USER_PWD) |
| 38 | + client = create_client(API_USER, USER_PWD) |
| 39 | + create_workspace_for_client(client) |
| 40 | + return client |
39 | 41 |
|
40 | 42 |
|
41 | 43 | @pytest.fixture(scope="function")
|
42 | 44 | def mc2():
|
43 |
| - return create_client(API_USER2, USER_PWD2) |
| 45 | + client = create_client(API_USER2, USER_PWD2) |
| 46 | + create_workspace_for_client(client) |
| 47 | + return client |
44 | 48 |
|
45 | 49 |
|
46 | 50 | def create_client(user, pwd):
|
47 | 51 | assert SERVER_URL and SERVER_URL.rstrip("/") != "https://app.merginmaps.com" and user and pwd
|
48 | 52 | return MerginClient(SERVER_URL, login=user, password=pwd)
|
49 | 53 |
|
50 | 54 |
|
| 55 | +def create_workspace_for_client(mc): |
| 56 | + try: |
| 57 | + mc.create_workspace(mc.username()) |
| 58 | + except ClientError: |
| 59 | + return |
| 60 | + |
| 61 | + |
51 | 62 | def cleanup(mc, project, dirs):
|
52 | 63 | # cleanup leftovers from previous test if needed such as remote project and local directories
|
53 | 64 | try:
|
@@ -1765,13 +1776,7 @@ def test_project_versions_list(mc, mc2):
|
1765 | 1776 | # now user shold have write access
|
1766 | 1777 | assert mc.has_writing_permissions(test_project_fullname)
|
1767 | 1778 |
|
1768 |
| - # test organization permissions |
1769 |
| - test_project_fullname = "testorg" + "/" + "test_org_permissions" |
1770 |
| - |
1771 | 1779 | # owner should have write access
|
1772 |
| - assert mc.has_writing_permissions(test_project_fullname) |
1773 |
| - |
1774 |
| - # writer should have write access |
1775 | 1780 | assert mc2.has_writing_permissions(test_project_fullname)
|
1776 | 1781 |
|
1777 | 1782 |
|
|
0 commit comments