File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change
1
+ import os
2
+
3
+ import pytest
4
+
5
+ from fdiff .diff import u_diff
6
+
7
+ ROBOTO_BEFORE_PATH = os .path .join ("tests" , "testfiles" , "Roboto-Regular.subset1.ttf" )
8
+ ROBOTO_AFTER_PATH = os .path .join ("tests" , "testfiles" , "Roboto-Regular.subset2.ttf" )
9
+ ROBOTO_UDIFF_EXPECTED_PATH = os .path .join ("tests" , "testfiles" , "roboto_udiff_expected.txt" )
10
+ ROBOTO_UDIFF_COLOR_EXPECTED_PATH = os .path .join ("tests" , "testfiles" , "roboto_udiff_color_expected.txt" )
11
+
12
+ # Setup: define the expected diff text for unified diff
13
+ with open (ROBOTO_UDIFF_EXPECTED_PATH , "r" ) as robo_udiff :
14
+ ROBOTO_UDIFF_EXPECTED = robo_udiff .read ()
15
+
16
+ # Setup: define the expected diff text for unified color diff
17
+ with open (ROBOTO_UDIFF_COLOR_EXPECTED_PATH , "r" ) as robo_udiff_color :
18
+ ROBOTO_UDIFF_COLOR_EXPECTED = robo_udiff_color .read ()
19
+
20
+
21
+ def test_unified_diff_default ():
22
+ res = u_diff (ROBOTO_BEFORE_PATH , ROBOTO_AFTER_PATH )
23
+ res_string = "" .join (res )
24
+ assert res_string == ROBOTO_UDIFF_EXPECTED
25
+
26
+
27
+
You can’t perform that action at this time.
0 commit comments