File tree Expand file tree Collapse file tree 2 files changed +36
-1
lines changed
src/python/pants/backend/python/dependency_inference Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,6 @@ def two_groups_hyphens_two_replacements_with_suffix(
100
100
],
101
101
re .compile (r"""^oslo-.+""" ): [all_hyphen_to_underscore ],
102
102
re .compile (r"""^python-(.+)""" ): [first_group_hyphen_to_underscore ],
103
- re .compile (r"""^python-(.+)""" ): [first_group_hyphen_to_underscore ],
104
103
}
105
104
106
105
DEFAULT_MODULE_MAPPING : Dict [str , Tuple [str , ...]] = {
Original file line number Diff line number Diff line change @@ -985,6 +985,42 @@ def test_generate_mappings_from_pattern_matches_para(
985
985
assert generate_mappings_from_pattern (proj_name , is_type_stub = False ) == expected_modules
986
986
987
987
988
+ @pytest .mark .parametrize (
989
+ ("proj_name" , "expected_modules" ),
990
+ [
991
+ (
992
+ "types-requests" ,
993
+ ("requests" ,),
994
+ ),
995
+ (
996
+ "botocore-stubs" ,
997
+ ("botocore" ,),
998
+ ),
999
+ (
1000
+ "django-types" ,
1001
+ ("django" ,),
1002
+ ),
1003
+ (
1004
+ "types_requests" ,
1005
+ ("requests" ,),
1006
+ ),
1007
+ (
1008
+ "botocore_stubs" ,
1009
+ ("botocore" ,),
1010
+ ),
1011
+ (
1012
+ "django_types" ,
1013
+ ("django" ,),
1014
+ ),
1015
+ ("" , tuple ()),
1016
+ ],
1017
+ )
1018
+ def test_generate_type_stub_mappings_from_pattern_matches_para (
1019
+ proj_name : str , expected_modules : Tuple [str ]
1020
+ ) -> None :
1021
+ assert generate_mappings_from_pattern (proj_name , is_type_stub = True ) == expected_modules
1022
+
1023
+
988
1024
def test_number_of_capture_groups_for_functions () -> None :
989
1025
with pytest .raises (ValueError ):
990
1026
re .sub ("foo" , first_group_hyphen_to_underscore , "foo" )
You can’t perform that action at this time.
0 commit comments