Skip to content

Commit

Permalink
Remove replaced tests
Browse files Browse the repository at this point in the history
  • Loading branch information
index-git committed Dec 19, 2023
1 parent 52a0784 commit d47d98a
Showing 1 changed file with 0 additions and 41 deletions.
41 changes: 0 additions & 41 deletions tests/static_data/single_publication/publications_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,47 +44,6 @@ def test_infos(workspace, publ_type, publication):
assert rest_detail['geodata_type'] == exp_geodata_type


@pytest.mark.parametrize('workspace, publ_type, publication', data.LIST_ALL_PUBLICATIONS)
@pytest.mark.usefixtures('oauth2_provider_mock', 'ensure_layman')
def test_auth_get_publications(workspace, publ_type, publication):
ensure_publication(workspace, publ_type, publication)

all_auth_info = util.get_users_and_headers_for_publication(workspace, publ_type, publication)
headers_list_in = all_auth_info['read'][util.KEY_AUTH][util.KEY_HEADERS]
headers_list_out = all_auth_info['read'][util.KEY_NOT_AUTH][util.KEY_HEADERS]

for in_headers in headers_list_in:
infos = process_client.get_publications(publ_type, workspace=workspace, headers=in_headers)
publication_names = [li['name'] for li in infos]
assert publication in publication_names, in_headers

for out_headers in headers_list_out:
infos = process_client.get_publications(publ_type, workspace=workspace, headers=out_headers)
publication_names = [li['name'] for li in infos]
assert publication not in publication_names, out_headers


@pytest.mark.parametrize('workspace, publ_type, publication', data.LIST_ALL_PUBLICATIONS)
@pytest.mark.usefixtures('oauth2_provider_mock', 'ensure_layman')
def test_auth_get_publication(workspace, publ_type, publication):
ensure_publication(workspace, publ_type, publication)

all_auth_info = util.get_users_and_headers_for_publication(workspace, publ_type, publication)
readers = all_auth_info['read'][util.KEY_AUTH][util.KEY_USERS]
non_readers = all_auth_info['read'][util.KEY_NOT_AUTH][util.KEY_USERS]

for user in readers:
with app.app_context():
pub_info = layman_util.get_publication_info(workspace, publ_type, publication, {'actor_name': user})
assert pub_info['name'] == publication, f'pub_info={pub_info}'
assert pub_info['type'] == publ_type, f'pub_info={pub_info}'

for user in non_readers:
with app.app_context():
pub_info = layman_util.get_publication_info(workspace, publ_type, publication, {'actor_name': user})
assert not pub_info, pub_info


@pytest.mark.parametrize('workspace, publ_type, publication', data.LIST_ALL_PUBLICATIONS)
@pytest.mark.usefixtures('oauth2_provider_mock', 'ensure_layman')
def test_internal_info(workspace, publ_type, publication):
Expand Down

0 comments on commit d47d98a

Please sign in to comment.