Skip to content

Commit e42ee6d

Browse files
committed
add: delete test_result_json1.txt
1 parent 138ce71 commit e42ee6d

File tree

2 files changed

+35
-30
lines changed

2 files changed

+35
-30
lines changed

tests/test_gendiff.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,10 @@
11
import os
22

33
from gendiff.gendiff import generate_diff
4-
from gendiff.io_utils import read_file
54

65
current_dir = os.path.dirname(os.path.abspath(__file__))
76
dir_with_data = os.path.join(current_dir, 'test_data')
87

9-
right_data1 = {
10-
"host": "hexlet.io",
11-
"timeout": 50,
12-
"proxy": "123.234.53.22",
13-
"follow": False
14-
}
15-
16-
right_data2 = {
17-
"timeout": 20,
18-
"verbose": True,
19-
"host": "hexlet.io"
20-
}
21-
22-
23-
def test_read_file():
24-
file1_json_path = os.path.join(dir_with_data, 'file1.json')
25-
file2_json_path = os.path.join(dir_with_data, 'file2.json')
26-
file1_yaml_path = os.path.join(dir_with_data, 'file1.yaml')
27-
file2_yaml_path = os.path.join(dir_with_data, 'file2.yaml')
28-
29-
assert read_file(file1_json_path) == right_data1
30-
assert read_file(file1_json_path) != right_data2
31-
assert read_file(file2_json_path) == right_data2
32-
assert read_file(file2_json_path) != right_data1
33-
assert read_file(file1_yaml_path) == right_data1
34-
assert read_file(file1_yaml_path) != right_data2
35-
assert read_file(file2_yaml_path) == right_data2
36-
assert read_file(file2_yaml_path) != right_data1
37-
388

399
def open_file(file_name: str) -> dict:
4010
test_file_path = os.path.join(dir_with_data, file_name)

tests/test_io_utils.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import os
2+
3+
from gendiff.io_utils import read_file
4+
5+
current_dir = os.path.dirname(os.path.abspath(__file__))
6+
dir_with_data = os.path.join(current_dir, 'test_data')
7+
8+
right_data1 = {
9+
"host": "hexlet.io",
10+
"timeout": 50,
11+
"proxy": "123.234.53.22",
12+
"follow": False
13+
}
14+
15+
right_data2 = {
16+
"timeout": 20,
17+
"verbose": True,
18+
"host": "hexlet.io"
19+
}
20+
21+
22+
def test_read_file():
23+
file1_json_path = os.path.join(dir_with_data, 'file1.json')
24+
file2_json_path = os.path.join(dir_with_data, 'file2.json')
25+
file1_yaml_path = os.path.join(dir_with_data, 'file1.yaml')
26+
file2_yaml_path = os.path.join(dir_with_data, 'file2.yaml')
27+
28+
assert read_file(file1_json_path) == right_data1
29+
assert read_file(file1_json_path) != right_data2
30+
assert read_file(file2_json_path) == right_data2
31+
assert read_file(file2_json_path) != right_data1
32+
assert read_file(file1_yaml_path) == right_data1
33+
assert read_file(file1_yaml_path) != right_data2
34+
assert read_file(file2_yaml_path) == right_data2
35+
assert read_file(file2_yaml_path) != right_data1

0 commit comments

Comments
 (0)