Skip to content

Commit

Permalink
TST: Add some for the python version replacer
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoZeke committed Nov 24, 2024
1 parent 202e347 commit b844124
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,3 +551,14 @@ def test_construct_pip_call(declaration, expected_result):
parsed_declaration = util.ParsedPipDeclaration(declaration)
result = util.construct_pip_call(pip_caller, parsed_declaration)
assert result() == expected_result


@pytest.mark.parametrize("arg, new_version, expected", [
("python", "3.10", "python=3.10"),
("python==2.7", "3.10", "python=3.10"),
("python>=3.8", "3.10", "python=3.10"),
("python==3.7", "3.10", "python=3.10"),
("python_package", "3.10", "python_package"),
])
def test_replace_python_version(arg, new_version, expected):
assert util.replace_python_version(arg, new_version) == expected

0 comments on commit b844124

Please sign in to comment.