Skip to content

Commit

Permalink
WIP on semver git tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Darren Weber committed Jun 19, 2019
1 parent 02cb8d1 commit 5658786
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/puzzle/test_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,25 @@ def test_search_for_vcs_read_setup_with_missing_tag(provider, mocker):
assert package.version.text == "0.1.2"


@pytest.mark.skipif(not PY35, reason="AST parsing does not work for Python <3.4")
def test_search_for_vcs_read_setup_with_semver_tag(provider, mocker):
mocker.patch("poetry.utils.env.Env.get", return_value=MockEnv())

dependency = VCSDependency(
"demo", "git", "https://github.com/demo/demo.git", tag="~0.1.0"
)
assert dependency.branch is None
assert dependency.rev is None
assert dependency.tag == "~0.1.0"

packages = provider.search_for_vcs(dependency)
assert len(packages) == 1
package = packages[0]
assert package.name == "demo"
assert package.version.text != dependency.tag
assert package.version.text == "0.1.2"


@pytest.mark.skipif(not PY35, reason="AST parsing does not work for Python <3.4")
def test_search_for_vcs_read_setup_with_extras(provider, mocker):
mocker.patch("poetry.utils.env.Env.get", return_value=MockEnv())
Expand Down

0 comments on commit 5658786

Please sign in to comment.