File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 21
21
def test_unified_diff_default ():
22
22
res = u_diff (ROBOTO_BEFORE_PATH , ROBOTO_AFTER_PATH )
23
23
res_string = "" .join (res )
24
- assert res_string == ROBOTO_UDIFF_EXPECTED
24
+ res_string_list = res_string .split ("\n " )
25
+ expected_string_list = ROBOTO_UDIFF_EXPECTED .split ("\n " )
26
+
27
+ # have to handle the tests for the top two file path lines
28
+ # differently than the rest of the comparisons because
29
+ # the time is defined using local platform settings
30
+ # which makes tests fail on remote CI testing services vs.
31
+ # my local testing platform...
32
+ for x , line in enumerate (res_string_list ):
33
+ # treat top two lines of the diff as comparison of first 10 chars only
34
+ if x in (0 , 1 ):
35
+ assert line [0 :9 ] == expected_string_list [x ][0 :9 ]
36
+ else :
37
+ assert line == expected_string_list [x ]
38
+
25
39
26
40
27
41
You can’t perform that action at this time.
0 commit comments