Skip to content
Snippets Groups Projects
Commit 037f4f2d authored by Simon Rose's avatar Simon Rose
Browse files

Added rest of the tests

parent 5fa0a81c
No related branches found
No related tags found
No related merge requests found
...@@ -84,6 +84,8 @@ def wrapper(tmpdir): ...@@ -84,6 +84,8 @@ def wrapper(tmpdir):
@pytest.mark.parametrize( @pytest.mark.parametrize(
"requested, expected, installed", "requested, expected, installed",
[ [
# If nothing is installed, nothing should be loaded
("test", "", []),
# Test versions can be loaded # Test versions can be loaded
("test", "test", ["test", "0.0.1"]), ("test", "test", ["test", "0.0.1"]),
# Numeric versions should be prioritized over test versions # Numeric versions should be prioritized over test versions
...@@ -95,6 +97,14 @@ def wrapper(tmpdir): ...@@ -95,6 +97,14 @@ def wrapper(tmpdir):
("0.0.1+0", "", ["0.0.1+1"]), ("0.0.1+0", "", ["0.0.1+1"]),
# If no build number is specified, load the highest build number # If no build number is specified, load the highest build number
("0.0.1", "0.0.1+4", ["0.1.0", "0.0.1+4", "0.0.1"]), ("0.0.1", "0.0.1+4", ["0.1.0", "0.0.1+4", "0.0.1"]),
# Build number 0 means load that version exactly
("0.0.1+0", "0.0.1+0", ["0.0.1+0"]),
("0.0.1+0", "0.0.1+0", ["0.0.1", "0.0.1+1", "1.0.0"]),
# 1-test counts as a test version, as does 1.0
("", "0.0.1+0", ["0.0.1", "1-test"]),
("", "0.0.1+0", ["0.0.1", "1.0"]),
# Numeric version should be prioritised over "higher" test version
("", "0.1.0+0", ["0.1.0", "1.0.0-rc1"]),
], ],
) )
def test_version(wrapper, requested, expected, installed): def test_version(wrapper, requested, expected, installed):
...@@ -113,6 +123,7 @@ def test_version(wrapper, requested, expected, installed): ...@@ -113,6 +123,7 @@ def test_version(wrapper, requested, expected, installed):
if expected: if expected:
match = re.search(RE_MODULE_LOADED.format(version=re.escape(expected)), o) match = re.search(RE_MODULE_LOADED.format(version=re.escape(expected)), o)
assert rc == 0
assert match assert match
else: else:
match = re.search(RE_MODULE_NOT_LOADED.format(required=re.escape(requested)), o) match = re.search(RE_MODULE_NOT_LOADED.format(required=re.escape(requested)), o)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment