|
4 | 4 |
|
5 | 5 |
|
6 | 6 | @pytest.mark.parametrize( |
7 | | - "path,call", [("/api/2.0/preview/scim/v2/Users", lambda w: w.users.list()), |
8 | | - ("/api/2.0/preview/scim/v2/Groups", lambda w: w.groups.list()), |
9 | | - ("/api/2.0/preview/scim/v2/ServicePrincipals", lambda w: w.service_principals.list()), ], |
| 7 | + "path,call", |
| 8 | + [("http://localhost/api/2.0/preview/scim/v2/Users", lambda w: w.users.list()), |
| 9 | + ("http://localhost/api/2.0/preview/scim/v2/Groups", lambda w: w.groups.list()), |
| 10 | + ("http://localhost/api/2.0/preview/scim/v2/ServicePrincipals", lambda w: w.service_principals.list()), ], |
10 | 11 | ) |
11 | 12 | def test_workspace_iam_list(config, requests_mock, path, call): |
12 | | - requests_mock.get(f"http://localhost{path}", |
13 | | - request_headers={ |
14 | | - "Accept": "application/json", |
15 | | - }, |
16 | | - text="null", |
17 | | - ) |
| 13 | + requests_mock.get(path, request_headers={"Accept": "application/json", }, text="null", ) |
18 | 14 | w = WorkspaceClient(config=config) |
19 | 15 | for _ in call(w): |
20 | 16 | pass |
21 | 17 | assert requests_mock.call_count == 1 |
22 | 18 | assert requests_mock.called |
23 | 19 |
|
24 | 20 |
|
25 | | -@pytest.mark.parametrize( |
26 | | - "path,call", |
27 | | - [("/api/2.0/accounts/%s/scim/v2/Users", lambda a: a.users.list()), |
28 | | - ("/api/2.0/accounts/%s/scim/v2/Groups", lambda a: a.groups.list()), |
29 | | - ("/api/2.0/accounts/%s/scim/v2/ServicePrincipals", lambda a: a.service_principals.list()), ], |
30 | | -) |
| 21 | +@pytest.mark.parametrize("path,call", [ |
| 22 | + ("http://localhost/api/2.0/accounts/%s/scim/v2/Users", lambda a: a.users.list()), |
| 23 | + ("http://localhost/api/2.0/accounts/%s/scim/v2/Groups", lambda a: a.groups.list()), |
| 24 | + ("http://localhost/api/2.0/accounts/%s/scim/v2/ServicePrincipals", lambda a: a.service_principals.list()), |
| 25 | +], |
| 26 | + ) |
31 | 27 | def test_account_iam_list(config, requests_mock, path, call): |
32 | 28 | config.account_id = "test_account_id" |
33 | 29 | requests_mock.get(path.replace("%s", config.account_id), |
|
0 commit comments