diff --git a/tests/test_main.py b/tests/test_main.py index 331afa45..bcebb86b 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -337,10 +337,10 @@ def test_packages_distributions_all_module_types(self): Version: 1.0.0 """, 'RECORD': ''.join( - f'{i}-top-level{suffix},,\n' - f'{i}-in-namespace/mod{suffix},,\n' - f'{i}-in-package/__init__.py,,\n' - f'{i}-in-package/mod{suffix},,\n' + f'top_level_{i}{suffix},,\n' + f'in_namespace_{i}/mod{suffix},,\n' + f'in_package_{i}/__init__.py,,\n' + f'in_package_{i}/mod{suffix},,\n' for i, suffix in enumerate(suffixes) ), }, @@ -351,6 +351,11 @@ def test_packages_distributions_all_module_types(self): distributions = packages_distributions() for i in range(len(suffixes)): - assert distributions[f'{i}-top-level'] == ['all_distributions'] - assert distributions[f'{i}-in-namespace'] == ['all_distributions'] - assert distributions[f'{i}-in-package'] == ['all_distributions'] + assert distributions[f'top_level_{i}'] == ['all_distributions'] + assert distributions[f'in_namespace_{i}'] == ['all_distributions'] + assert distributions[f'in_package_{i}'] == ['all_distributions'] + + # All keys return from packages_distributions() should be valid import + # names, which means that they must _at least_ be valid identifiers: + for import_name in distributions.keys(): + assert import_name.isidentifier(), import_name