@@ -85,19 +85,17 @@ def _insert_implicit_postcode(osm_id, country, geometry, address):
85
85
return _insert_implicit_postcode
86
86
87
87
88
- def test_postcodes_empty (dsn , postcode_table , place_table ,
89
- tmp_path , tokenizer ):
90
- postcodes .update_postcodes (dsn , tmp_path , tokenizer )
88
+ def test_postcodes_empty (dsn , postcode_table , place_table , tokenizer ):
89
+ postcodes .update_postcodes (dsn , None , tokenizer )
91
90
92
91
assert not postcode_table .row_set
93
92
94
93
95
- def test_postcodes_add_new (dsn , postcode_table , tmp_path ,
96
- insert_implicit_postcode , tokenizer ):
94
+ def test_postcodes_add_new (dsn , postcode_table , insert_implicit_postcode , tokenizer ):
97
95
insert_implicit_postcode (1 , 'xx' , 'POINT(10 12)' , dict (postcode = '9486' ))
98
96
postcode_table .add ('yy' , '9486' , 99 , 34 )
99
97
100
- postcodes .update_postcodes (dsn , tmp_path , tokenizer )
98
+ postcodes .update_postcodes (dsn , None , tokenizer )
101
99
102
100
assert postcode_table .row_set == {('xx' , '9486' , 10 , 12 ), }
103
101
@@ -112,49 +110,48 @@ def test_postcodes_replace_coordinates(dsn, postcode_table, tmp_path,
112
110
assert postcode_table .row_set == {('xx' , 'AB 4511' , 10 , 12 )}
113
111
114
112
115
- def test_postcodes_replace_coordinates_close (dsn , postcode_table , tmp_path ,
113
+ def test_postcodes_replace_coordinates_close (dsn , postcode_table ,
116
114
insert_implicit_postcode , tokenizer ):
117
115
insert_implicit_postcode (1 , 'xx' , 'POINT(10 12)' , dict (postcode = 'AB 4511' ))
118
116
postcode_table .add ('xx' , 'AB 4511' , 10 , 11.99999 )
119
117
120
- postcodes .update_postcodes (dsn , tmp_path , tokenizer )
118
+ postcodes .update_postcodes (dsn , None , tokenizer )
121
119
122
120
assert postcode_table .row_set == {('xx' , 'AB 4511' , 10 , 11.99999 )}
123
121
124
122
125
- def test_postcodes_remove (dsn , postcode_table , tmp_path ,
123
+ def test_postcodes_remove (dsn , postcode_table ,
126
124
insert_implicit_postcode , tokenizer ):
127
125
insert_implicit_postcode (1 , 'xx' , 'POINT(10 12)' , dict (postcode = 'AB 4511' ))
128
126
postcode_table .add ('xx' , 'badname' , 10 , 12 )
129
127
130
- postcodes .update_postcodes (dsn , tmp_path , tokenizer )
128
+ postcodes .update_postcodes (dsn , None , tokenizer )
131
129
132
130
assert postcode_table .row_set == {('xx' , 'AB 4511' , 10 , 12 )}
133
131
134
132
135
- def test_postcodes_ignore_empty_country (dsn , postcode_table , tmp_path ,
133
+ def test_postcodes_ignore_empty_country (dsn , postcode_table ,
136
134
insert_implicit_postcode , tokenizer ):
137
135
insert_implicit_postcode (1 , None , 'POINT(10 12)' , dict (postcode = 'AB 4511' ))
138
- postcodes .update_postcodes (dsn , tmp_path , tokenizer )
136
+ postcodes .update_postcodes (dsn , None , tokenizer )
139
137
assert not postcode_table .row_set
140
138
141
139
142
- def test_postcodes_remove_all (dsn , postcode_table , place_table ,
143
- tmp_path , tokenizer ):
140
+ def test_postcodes_remove_all (dsn , postcode_table , place_table , tokenizer ):
144
141
postcode_table .add ('ch' , '5613' , 10 , 12 )
145
- postcodes .update_postcodes (dsn , tmp_path , tokenizer )
142
+ postcodes .update_postcodes (dsn , None , tokenizer )
146
143
147
144
assert not postcode_table .row_set
148
145
149
146
150
- def test_postcodes_multi_country (dsn , postcode_table , tmp_path ,
147
+ def test_postcodes_multi_country (dsn , postcode_table ,
151
148
insert_implicit_postcode , tokenizer ):
152
149
insert_implicit_postcode (1 , 'de' , 'POINT(10 12)' , dict (postcode = '54451' ))
153
150
insert_implicit_postcode (2 , 'cc' , 'POINT(100 56)' , dict (postcode = 'DD23 T' ))
154
151
insert_implicit_postcode (3 , 'de' , 'POINT(10.3 11.0)' , dict (postcode = '54452' ))
155
152
insert_implicit_postcode (4 , 'cc' , 'POINT(10.3 11.0)' , dict (postcode = '54452' ))
156
153
157
- postcodes .update_postcodes (dsn , tmp_path , tokenizer )
154
+ postcodes .update_postcodes (dsn , None , tokenizer )
158
155
159
156
assert postcode_table .row_set == {('de' , '54451' , 10 , 12 ),
160
157
('de' , '54452' , 10.3 , 11.0 ),
@@ -211,7 +208,7 @@ def test_can_compute(dsn, table_factory):
211
208
assert postcodes .can_compute (dsn )
212
209
213
210
214
- def test_no_placex_entry (dsn , tmp_path , temp_db_cursor , place_row , postcode_table , tokenizer ):
211
+ def test_no_placex_entry (dsn , temp_db_cursor , place_row , postcode_table , tokenizer ):
215
212
# Rewrite the get_country_code function to verify its execution.
216
213
temp_db_cursor .execute ("""
217
214
CREATE OR REPLACE FUNCTION get_country_code(place geometry)
@@ -220,12 +217,12 @@ def test_no_placex_entry(dsn, tmp_path, temp_db_cursor, place_row, postcode_tabl
220
217
END; $$ LANGUAGE plpgsql;
221
218
""" )
222
219
place_row (geom = 'SRID=4326;POINT(10 12)' , address = dict (postcode = 'AB 4511' ))
223
- postcodes .update_postcodes (dsn , tmp_path , tokenizer )
220
+ postcodes .update_postcodes (dsn , None , tokenizer )
224
221
225
222
assert postcode_table .row_set == {('yy' , 'AB 4511' , 10 , 12 )}
226
223
227
224
228
- def test_discard_badly_formatted_postcodes (dsn , tmp_path , temp_db_cursor , place_row ,
225
+ def test_discard_badly_formatted_postcodes (dsn , temp_db_cursor , place_row ,
229
226
postcode_table , tokenizer ):
230
227
# Rewrite the get_country_code function to verify its execution.
231
228
temp_db_cursor .execute ("""
@@ -235,6 +232,6 @@ def test_discard_badly_formatted_postcodes(dsn, tmp_path, temp_db_cursor, place_
235
232
END; $$ LANGUAGE plpgsql;
236
233
""" )
237
234
place_row (geom = 'SRID=4326;POINT(10 12)' , address = dict (postcode = 'AB 4511' ))
238
- postcodes .update_postcodes (dsn , tmp_path , tokenizer )
235
+ postcodes .update_postcodes (dsn , None , tokenizer )
239
236
240
237
assert not postcode_table .row_set
0 commit comments