Skip to content

Commit 0784bcf

Browse files
committed
fix another unit test
1 parent 1f023c1 commit 0784bcf

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/unit/test_hist_config.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,12 @@ def test_flat_user_nl_cam(self):
9999
hist_configs = HistoryConfig(filename=in_source, logger=hist_log)
100100
# end with
101101
# Check that the first few lines of the log are as expected
102-
expected_logmsg = ["DEBUG:hist_log:Added average field, 'MOE' to hist volume, h1, at /glade/u/home/courtneyp/Projects/sima-history-clean/test/unit/sample_files/hist_config_files/user_nl_cam_flat:5",
103-
"DEBUG:hist_log:Added average field, 'LARRY' to hist volume, h1, at /glade/u/home/courtneyp/Projects/sima-history-clean/test/unit/sample_files/hist_config_files/user_nl_cam_flat:5",
104-
"DEBUG:hist_log:Added average field, 'CURLY' to hist volume, h1, at /glade/u/home/courtneyp/Projects/sima-history-clean/test/unit/sample_files/hist_config_files/user_nl_cam_flat:5"]
105-
self.assertEqual(cmplog.output[0:3], expected_logmsg)
102+
expected_logmsg = ["DEBUG:hist_log:Added average field, 'MOE' to hist volume, h1, at",
103+
"DEBUG:hist_log:Added average field, 'LARRY' to hist volume, h1, at",
104+
"DEBUG:hist_log:Added average field, 'CURLY' to hist volume, h1, at"]
105+
for index, expected_log in enumerate(expected_logmsg):
106+
self.assertTrue(cmplog.output[index].startswith(expected_log))
107+
# end for
106108
# Check that HistoryConfig object was created
107109
amsg = "Test failure: no HistConfig object created"
108110
self.assertTrue(isinstance(hist_configs, HistoryConfig), msg=amsg)

0 commit comments

Comments
 (0)