|
8 | 8 |
|
9 | 9 | @pytest.mark.parametrize(('filename', 'expected_retval'), ( |
10 | 10 | ('not_pretty_formatted_json.json', 1), |
| 11 | + ('unsorted_pretty_formatted_json.json', 1), |
11 | 12 | ('pretty_formatted_json.json', 0), |
12 | 13 | )) |
13 | 14 | def test_pretty_format_json(filename, expected_retval): |
14 | 15 | ret = pretty_format_json([get_resource_path(filename)]) |
15 | 16 | assert ret == expected_retval |
16 | 17 |
|
17 | 18 |
|
| 19 | +@pytest.mark.parametrize(('filename', 'expected_retval'), ( |
| 20 | + ('not_pretty_formatted_json.json', 1), |
| 21 | + ('unsorted_pretty_formatted_json.json', 0), |
| 22 | + ('pretty_formatted_json.json', 0), |
| 23 | +)) |
| 24 | +def test_unsorted_pretty_format_json(filename, expected_retval): |
| 25 | + ret = pretty_format_json(['--no-sort-keys', get_resource_path(filename)]) |
| 26 | + assert ret == expected_retval |
| 27 | + |
| 28 | + |
18 | 29 | def test_autofix_pretty_format_json(tmpdir): |
19 | 30 | srcfile = tmpdir.join('to_be_json_formatted.json') |
20 | 31 | with io.open(get_resource_path('not_pretty_formatted_json.json')) as f: |
|
0 commit comments