@@ -47,8 +47,9 @@ def test_read_file_json(temp_dir_with_files):
4747 file1_path = os .path .join (temp_dir_with_files , 'file1.json' )
4848 file2_path = os .path .join (temp_dir_with_files , 'file2.json' )
4949 assert read_file_json (file1_path ) == data1
50-
50+ assert read_file_json ( file1_path ) != data2
5151 assert read_file_json (file2_path ) == data2
52+ assert read_file_json (file2_path ) != data1
5253
5354
5455def test_sort_list ():
@@ -62,17 +63,24 @@ def test_sort_list():
6263 {'key' : 'qwe' , 'sign' : '-' , 'value' : 3 },
6364 {'key' : 'qwe' , 'sign' : '+' , 'value' : 3 },
6465 ]
66+ assert sort_list (lst ) != [
67+ {'key' : 'abc' , 'sign' : ' ' , 'value' : 3 },
68+ {'key' : 'qwe' , 'sign' : '+' , 'value' : 3 },
69+ {'key' : 'qwe' , 'sign' : '-' , 'value' : 3 },
70+ ]
6571
6672
6773def test_generate_diff (temp_dir_with_files ):
6874 right_str = ("{\n "
69- " - follow: false\n "
70- " host: hexlet.io\n "
71- " - proxy: 123.234.53.22\n "
72- " - timeout: 50\n "
73- " + timeout: 20\n "
74- " + verbose: true\n "
75- "}" )
75+ " - follow: false\n "
76+ " host: hexlet.io\n "
77+ " - proxy: 123.234.53.22\n "
78+ " - timeout: 50\n "
79+ " + timeout: 20\n "
80+ " + verbose: true\n "
81+ "}" )
82+ wrong_str = ''
7683 file1_path = os .path .join (temp_dir_with_files , 'file1.json' )
7784 file2_path = os .path .join (temp_dir_with_files , 'file2.json' )
7885 assert generate_diff (file1_path , file2_path ) == right_str
86+ assert generate_diff (file1_path , file2_path ) != wrong_str
0 commit comments