@@ -114,7 +114,7 @@ def test_am_binary_bulletin():
114
114
115
115
# Check renamer.
116
116
renamer .after_gather (worklist )
117
- assert worklist .incoming [0 ]['relPath' ]. split ( '/' )[ - 1 ] == 'ISAA41_CYWA_030000___00001'
117
+ assert worklist .incoming [0 ]['rename' ] == 'ISAA41_CYWA_030000___00001'
118
118
119
119
120
120
# Test 2: Check a regular CACN bulletin
@@ -146,7 +146,7 @@ def test_cacn_regular():
146
146
worklist .incoming = [message_test2 ]
147
147
148
148
renamer .after_gather (worklist )
149
- assert worklist .incoming [0 ]['relPath' ]. split ( '/' )[ - 1 ] == 'CACN00_CWAO_021600__WVO_00001'
149
+ assert worklist .incoming [0 ]['rename' ] == 'CACN00_CWAO_021600__WVO_00001'
150
150
151
151
# Test 3: Check an erronous CACN bulletin (missing timestamp in bulletin contents)
152
152
def test_cacn_erronous ():
@@ -179,7 +179,7 @@ def test_cacn_erronous():
179
179
180
180
181
181
renamer .after_gather (worklist )
182
- assert re .match ('CACN00_CWAO_......__WPK_00001_PROBLEM' , worklist .incoming [0 ]['relPath' ]. split ( '/' )[ - 1 ])
182
+ assert re .match ('CACN00_CWAO_......__WPK_00001_PROBLEM' , worklist .incoming [0 ]['rename' ])
183
183
184
184
# Test 4: Bulletin with double line separator after header (my-header\n\n)
185
185
def test_bulletin_double_linesep ():
@@ -211,7 +211,7 @@ def test_bulletin_double_linesep():
211
211
worklist .incoming = [message_test4 ]
212
212
213
213
renamer .after_gather (worklist )
214
- assert message_test4 ['relPath' ]. split ( '/' )[ - 1 ] == 'SXCN35_CWVR_021100___00001'
214
+ assert message_test4 ['rename' ] == 'SXCN35_CWVR_021100___00001'
215
215
216
216
# Test 5: Bulletin with invalid year in timestamp (Fix: https://github.com/MetPX/sarracenia/pull/973)
217
217
def test_bulletin_invalid_timestamp (caplog ):
@@ -228,7 +228,7 @@ def test_bulletin_invalid_timestamp(caplog):
228
228
bulletin , firstchars , lines , missing_ahl , station , charset = _get_bulletin_info (message_test5 )
229
229
230
230
bulletinHeader = lines [0 ].decode ('iso-8859-1' ).replace (' ' , '_' )
231
- message_test5 ['relPath' ]. split ( '/' )[ - 1 ] = bulletinHeader + '__12345'
231
+ message_test5 ['rename' ] = bulletinHeader + '__12345'
232
232
message_test5 ['relPath' ].split ('/' )[- 2 :] = BaseOptions .directory
233
233
234
234
new_bulletin , isProblem = am_instance .correctContents (bulletin , firstchars , lines , missing_ahl , station , charset )
@@ -298,7 +298,7 @@ def test_bulletin_wrong_station():
298
298
worklist .incoming = [message_test7 ]
299
299
300
300
renamer .after_gather (worklist )
301
- assert worklist .incoming [0 ]['relPath' ]. split ( '/' )[ - 1 ] == 'UECN99_CYCX_071200___00001_PROBLEM'
301
+ assert worklist .incoming [0 ]['rename' ] == 'UECN99_CYCX_071200___00001_PROBLEM'
302
302
303
303
# Test 8: SM Bulletin - Add station mapping + SM/SI bulletin accomodities
304
304
def test_SM_bulletin ():
@@ -329,7 +329,7 @@ def test_SM_bulletin():
329
329
worklist .incoming = [message_test8 ]
330
330
331
331
renamer .after_gather (worklist )
332
- assert worklist .incoming [0 ]['relPath' ]. split ( '/' )[ - 1 ] == 'SMCN06_CWAO_030000__71816_00001'
332
+ assert worklist .incoming [0 ]['rename' ] == 'SMCN06_CWAO_030000__71816_00001'
333
333
334
334
# Test 9: Bulletin with 5 fields in header (invalid)
335
335
def test_bulletin_header_five_fileds ():
@@ -420,7 +420,7 @@ def test_random_bulletin_with_BBB():
420
420
worklist .incoming = [message_test12 ]
421
421
422
422
renamer .after_gather (worklist )
423
- assert worklist .incoming [0 ]['relPath' ]. split ( '/' )[ - 1 ] == 'FXCN06_CYTR_230939_AAA__00001'
423
+ assert worklist .incoming [0 ]['rename' ] == 'FXCN06_CYTR_230939_AAA__00001'
424
424
425
425
# Test 13: SM Bulletin with BBB - Add station mapping + SM/SI bulletin accomodities + conserve BBB header
426
426
def test_SM_bulletin_with_BBB ():
@@ -451,4 +451,4 @@ def test_SM_bulletin_with_BBB():
451
451
worklist .incoming = [message_test13 ]
452
452
453
453
renamer .after_gather (worklist )
454
- assert worklist .incoming [0 ]['relPath' ]. split ( '/' )[ - 1 ] == 'SMCN06_CWAO_030000_AAA_71816_00001'
454
+ assert worklist .incoming [0 ]['rename' ] == 'SMCN06_CWAO_030000_AAA_71816_00001'
0 commit comments