Skip to content

Commit 372e77b

Browse files
andreleblanc11petersilva
authored andcommitted
Fix #1385
1 parent a5fd5ed commit 372e77b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tests/sarracenia/flowcb/gather/am__gather_test.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def test_am_binary_bulletin():
114114

115115
# Check renamer.
116116
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'
118118

119119

120120
# Test 2: Check a regular CACN bulletin
@@ -146,7 +146,7 @@ def test_cacn_regular():
146146
worklist.incoming = [message_test2]
147147

148148
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'
150150

151151
# Test 3: Check an erronous CACN bulletin (missing timestamp in bulletin contents)
152152
def test_cacn_erronous():
@@ -179,7 +179,7 @@ def test_cacn_erronous():
179179

180180

181181
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'])
183183

184184
# Test 4: Bulletin with double line separator after header (my-header\n\n)
185185
def test_bulletin_double_linesep():
@@ -211,7 +211,7 @@ def test_bulletin_double_linesep():
211211
worklist.incoming = [message_test4]
212212

213213
renamer.after_gather(worklist)
214-
assert message_test4['relPath'].split('/')[-1] == 'SXCN35_CWVR_021100___00001'
214+
assert message_test4['rename'] == 'SXCN35_CWVR_021100___00001'
215215

216216
# Test 5: Bulletin with invalid year in timestamp (Fix: https://github.com/MetPX/sarracenia/pull/973)
217217
def test_bulletin_invalid_timestamp(caplog):
@@ -228,7 +228,7 @@ def test_bulletin_invalid_timestamp(caplog):
228228
bulletin, firstchars, lines, missing_ahl, station, charset = _get_bulletin_info(message_test5)
229229

230230
bulletinHeader = lines[0].decode('iso-8859-1').replace(' ', '_')
231-
message_test5['relPath'].split('/')[-1] = bulletinHeader + '__12345'
231+
message_test5['rename'] = bulletinHeader + '__12345'
232232
message_test5['relPath'].split('/')[-2:] = BaseOptions.directory
233233

234234
new_bulletin, isProblem = am_instance.correctContents(bulletin, firstchars, lines, missing_ahl, station, charset)
@@ -298,7 +298,7 @@ def test_bulletin_wrong_station():
298298
worklist.incoming = [message_test7]
299299

300300
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'
302302

303303
# Test 8: SM Bulletin - Add station mapping + SM/SI bulletin accomodities
304304
def test_SM_bulletin():
@@ -329,7 +329,7 @@ def test_SM_bulletin():
329329
worklist.incoming = [message_test8]
330330

331331
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'
333333

334334
# Test 9: Bulletin with 5 fields in header (invalid)
335335
def test_bulletin_header_five_fileds():
@@ -420,7 +420,7 @@ def test_random_bulletin_with_BBB():
420420
worklist.incoming = [message_test12]
421421

422422
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'
424424

425425
# Test 13: SM Bulletin with BBB - Add station mapping + SM/SI bulletin accomodities + conserve BBB header
426426
def test_SM_bulletin_with_BBB():
@@ -451,4 +451,4 @@ def test_SM_bulletin_with_BBB():
451451
worklist.incoming = [message_test13]
452452

453453
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

Comments
 (0)