Skip to content

Commit

Permalink
Add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zz1874 committed Aug 30, 2023
1 parent 2aeeb27 commit cae4ffd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ def test_package__identity_mapping(
["foobar", "and", "other", "names"],
id="name_with_three_imports__matches_third_import",
),
pytest.param(
"types-requests",
{"requests-stubs"},
["requests", "and", "other", "names"],
["types_requests", "and", "other", "names"],
id="name_with_stubs_suffix__matches_name_without_suffix",
),
],
)
def test_package__local_env_mapping(
Expand Down Expand Up @@ -264,6 +271,11 @@ def test_user_defined_mapping__no_input__returns_empty_mapping():
{"typing_extensions"},
id="package_with_hyphen__provides_import_name_with_underscore",
),
pytest.param(
"types-setuptools",
{"pkg_resources-stubs", "setuptools-stubs"},
id="package_using_typeshed__provides_import_name_with_stubs_suffix",
),
],
)
def test_LocalPackageResolver_lookup_packages(
Expand Down
2 changes: 2 additions & 0 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ def deps_factory(*deps: str, path: str = "foo") -> List[DeclaredDependency]:
"setuptools": {"setuptools", "pkg_resources", "_distutils_hack"},
"isort": {"isort"},
"typing-extensions": {"typing_extensions"},
"types-setuptools": {"setuptools-stubs", "pkg_resources-stubs"},
"types-requests": {"requests-stubs"},
}


Expand Down

0 comments on commit cae4ffd

Please sign in to comment.