Skip to content

Commit

Permalink
Unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
analog-cbarber committed Sep 10, 2023
1 parent 8b1caf9 commit 7bd562f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/cli/test_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,16 @@ def test_rename_options(
"",
).run()

test_case(
[str(simple_wheel), "-R", "[bad", "bad"],
expected_parser_error="Bad dependency rename pattern",
).run()

test_case(
[str(simple_wheel), "-R", "acme-(.*)", "acme.$2"],
expected_parser_error="Bad dependency replacement",
).run()


def test_build_number(
test_case: CliTestCaseFactory,
Expand Down
20 changes: 20 additions & 0 deletions test/impl/test_pyproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,26 @@ def test_read_pyproject(tmp_path: Path) -> None:
assert pyproj3.extra_dependencies == ("conda-only",)
assert pyproj3.conda_format is CondaPackageFormat.V1

#
# Test poetry name
#
proj_file.write_text(
dedent(
r"""
[build-system]
requires = ["poetry-core","setuptools"]
build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "poetry.example"
version = "1.0.2"
"""
),
encoding="ascii",
)
pyproj4 = read_pyproject(tmp_path)
assert pyproj4.name == "poetry.example"

#
# Test bad value warnings
#
Expand Down

0 comments on commit 7bd562f

Please sign in to comment.