File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 1+ import json
12from pathlib import Path
23
34from gendiff .data import read_data
45
56
67def get_test_data_path (filename ):
7- return Path (__file__ ).parent / "tests" / filename
8+ return Path (__file__ ).parent / filename
89
910
1011def read_file (filename ):
11- return get_test_data_path (filename ).read_text ()
12+ with open (get_test_data_path (filename ), "r" ) as file :
13+ text = json .load (file )
14+ return text
1215
1316
1417def test_read_data ():
1518 file1 = get_test_data_path ("file_1.json" )
1619 file2 = get_test_data_path ("file_2.json" )
17- expec1 = read_file ("r_data1.txt " )
18- expec2 = read_file ("r_data2.txt " )
20+ expec1 = read_file ("file_1.json " )
21+ expec2 = read_file ("file_2.json " )
1922
2023 assert read_data (file1 ) == expec1
2124 assert read_data (file2 ) == expec2
You can’t perform that action at this time.
0 commit comments