@@ -38,21 +38,51 @@ def test_get_code_from_name_org_type():
38
38
get_code_from_name (
39
39
"NATIONAL_NGO" ,
40
40
actual_org_type_lookup ,
41
+ [],
42
+ fuzzy_match = False ,
41
43
)
42
44
== "441"
43
45
)
44
46
assert (
45
47
get_code_from_name (
46
48
"COOPÉRATION_INTERNATIONALE" ,
47
49
actual_org_type_lookup ,
50
+ [],
51
+ fuzzy_match = False ,
52
+ )
53
+ is None
54
+ )
55
+ unmatched = []
56
+ assert (
57
+ get_code_from_name (
58
+ "COOPÉRATION_INTERNATIONALE" ,
59
+ actual_org_type_lookup ,
60
+ unmatched ,
61
+ fuzzy_match = True ,
62
+ )
63
+ is None
64
+ )
65
+ assert (
66
+ get_code_from_name (
67
+ "COOPÉRATION_INTERNATIONALE" ,
68
+ actual_org_type_lookup ,
69
+ unmatched ,
70
+ fuzzy_match = True ,
71
+ )
72
+ is None
73
+ )
74
+ assert (
75
+ get_code_from_name (
76
+ "NGO" , actual_org_type_lookup , [], fuzzy_match = False
48
77
)
49
78
is None
50
79
)
51
- assert get_code_from_name ("NGO" , actual_org_type_lookup ) is None
52
80
assert (
53
81
get_code_from_name (
54
82
"International" ,
55
83
actual_org_type_lookup ,
84
+ [],
85
+ fuzzy_match = False ,
56
86
)
57
87
is None
58
88
)
@@ -100,16 +130,29 @@ def test_get_code_from_name_sector():
100
130
actual_sector_lookup = {normalise (k ): v for k , v in sector_lookup .items ()}
101
131
actual_sector_lookup .update (sector_map )
102
132
assert (
103
- get_code_from_name ("education" , actual_sector_lookup , fuzzy_match = True )
133
+ get_code_from_name (
134
+ "education" , actual_sector_lookup , [], fuzzy_match = True
135
+ )
104
136
== "EDU"
105
137
)
106
138
assert (
107
139
get_code_from_name (
108
- "LOGISTIQUE" , actual_sector_lookup , fuzzy_match = True
140
+ "LOGISTIQUE" , actual_sector_lookup , [], fuzzy_match = True
109
141
)
110
142
== "LOG"
111
143
)
112
- assert get_code_from_name ("CCCM" , actual_sector_lookup ) == "CCM"
113
- assert get_code_from_name ("Santé" , actual_sector_lookup ) == "HEA"
144
+ assert (
145
+ get_code_from_name ("CCCM" , actual_sector_lookup , [], fuzzy_match = False )
146
+ == "CCM"
147
+ )
148
+ assert (
149
+ get_code_from_name (
150
+ "Santé" , actual_sector_lookup , [], fuzzy_match = False
151
+ )
152
+ == "HEA"
153
+ )
114
154
actual_sector_lookup ["cccm" ] = "CCM"
115
- assert get_code_from_name ("CCS" , actual_sector_lookup ) is None
155
+ assert (
156
+ get_code_from_name ("CCS" , actual_sector_lookup , [], fuzzy_match = False )
157
+ is None
158
+ )
0 commit comments