From 7bd562f65ffbd1574ed88e203293c3047d93badd Mon Sep 17 00:00:00 2001 From: Christopher Barber Date: Sun, 10 Sep 2023 16:05:29 -0400 Subject: [PATCH] Unit tests --- test/cli/test_convert.py | 10 ++++++++++ test/impl/test_pyproject.py | 20 ++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/test/cli/test_convert.py b/test/cli/test_convert.py index 97fa950..4b00f90 100644 --- a/test/cli/test_convert.py +++ b/test/cli/test_convert.py @@ -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, diff --git a/test/impl/test_pyproject.py b/test/impl/test_pyproject.py index b2558f5..cc03e7b 100644 --- a/test/impl/test_pyproject.py +++ b/test/impl/test_pyproject.py @@ -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 #