Skip to content

Commit

Permalink
update units for prerelease
Browse files Browse the repository at this point in the history
  • Loading branch information
briantist committed Sep 28, 2023
1 parent fc7579f commit ca69b3b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
24 changes: 23 additions & 1 deletion tests/unit/utilities/test_collected_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_collected_collections_skip_missing_version(repository, props):


@pytest.mark.parametrize('namespace', [None, 'community', 'briantist', 'fake'])
@pytest.mark.parametrize('collection', [None, 'whatever', 'hashi_vault', 'fake'])
@pytest.mark.parametrize('collection', [None, 'whatever', 'hashi_vault', 'fake', 'devel'])
@pytest.mark.parametrize('scheme', [None, '', 'https'])
def test_collected_collections_any(repository, discover_collections, namespace, collection, scheme, app_request_context):
fqcn = None if any([namespace is None, collection is None]) else f"{namespace}.{collection}"
Expand Down Expand Up @@ -62,3 +62,25 @@ def test_collected_collections_any(repository, discover_collections, namespace,
assert ver == vd

assert cols <= len(contents)

@pytest.mark.parametrize('namespace', ['briantist'])
@pytest.mark.parametrize('collection', ['devel'])
def test_collected_collections_pre_only(repository, discover_collections, namespace, collection, app_request_context):
collections = collected_collections(repository, namespace, collection)

contents = list(repository)

cols = 0

for col, data in collections.items():
assert col == f"{namespace}.{collection}"
assert 'versions' in data
assert 'latest' in data
assert data['latest']['version'] == '0.1.0-dev1'

Check warning on line 79 in tests/unit/utilities/test_collected_collections.py

View check run for this annotation

Codecov / codecov/patch

tests/unit/utilities/test_collected_collections.py#L76-L79

Added lines #L76 - L79 were not covered by tests

for v, vd in data['versions'].items():
cols += 1

Check warning on line 82 in tests/unit/utilities/test_collected_collections.py

View check run for this annotation

Codecov / codecov/patch

tests/unit/utilities/test_collected_collections.py#L81-L82

Added lines #L81 - L82 were not covered by tests
# ver = next(discover_collections(repository, namespace=vd['namespace']['name'], name=vd['name'], version=v, scheme=scheme))
# assert ver == vd

assert cols <= len(contents)
4 changes: 2 additions & 2 deletions tests/unit/utilities/test_discover_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def test_discover_collections_skip_missing_version(repository, props):


@pytest.mark.parametrize('namespace', [None, 'community', 'briantist', 'fake'])
@pytest.mark.parametrize('collection', [None, 'whatever', 'hashi_vault', 'fake'])
@pytest.mark.parametrize('version', [None, '2.5.0', '3.0.0', '0.1.0', '0.2.0', '0.0.0'])
@pytest.mark.parametrize('collection', [None, 'whatever', 'hashi_vault', 'devel', 'fake'])
@pytest.mark.parametrize('version', [None, '2.5.0', '3.0.0', '0.1.0', '0.2.0', '0.0.0', '0.1.0-dev0', '0.1.0-dev1', '0.2.0-dev0'])
def test_discover_collections_any(repository, manifest_loader, namespace, collection, version, app_request_context):
gen = discover_collections(repository, namespace, collection, version)

Expand Down

0 comments on commit ca69b3b

Please sign in to comment.