mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-11 05:44:16 +00:00
add test to show how it works a bit more
This commit is contained in:
parent
84b1fb6827
commit
e9e9c3d577
2 changed files with 21 additions and 0 deletions
16
testing/resources/top_sorted_json.json
Normal file
16
testing/resources/top_sorted_json.json
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
"01-alist": [
|
||||||
|
2,
|
||||||
|
34,
|
||||||
|
234
|
||||||
|
],
|
||||||
|
"alist": [
|
||||||
|
2,
|
||||||
|
34,
|
||||||
|
234
|
||||||
|
],
|
||||||
|
"00-foo": "bar",
|
||||||
|
"02-blah": null,
|
||||||
|
"blah": null,
|
||||||
|
"foo": "bar"
|
||||||
|
}
|
||||||
|
|
@ -75,6 +75,11 @@ def test_not_orderfile_get_pretty_format():
|
||||||
assert ret == 1
|
assert ret == 1
|
||||||
|
|
||||||
|
|
||||||
|
def test_top_sorted_get_pretty_format():
|
||||||
|
ret = pretty_format_json(['--top-keys=01-alist,alist', get_resource_path('top_sorted_json.json')])
|
||||||
|
assert ret == 0
|
||||||
|
|
||||||
|
|
||||||
def test_badfile_pretty_format_json():
|
def test_badfile_pretty_format_json():
|
||||||
ret = pretty_format_json([get_resource_path('ok_yaml.yaml')])
|
ret = pretty_format_json([get_resource_path('ok_yaml.yaml')])
|
||||||
assert ret == 1
|
assert ret == 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue