adds top keys list of keys in hashes to put at the top of a hash
This adds custom sorting to preferencially add a list of top keys
at the start of any json hash in the json document
diff --git a/tests/pretty_format_json_test.py b/tests/pretty_format_json_test.py
index d9061d3..387a1bf 100644
--- a/tests/pretty_format_json_test.py
+++ b/tests/pretty_format_json_test.py
@@ -64,6 +64,13 @@
ret = pretty_format_json([srcfile.strpath])
assert ret == 0
+def test_orderfile_get_pretty_format():
+ ret = pretty_format_json(['--top-keys=alist', get_resource_path('pretty_formatted_json.json')])
+ assert ret == 0
+
+def test_orderfile_get_pretty_format():
+ ret = pretty_format_json(['--top-keys=blah', get_resource_path('pretty_formatted_json.json')])
+ assert ret == 1
def test_badfile_pretty_format_json():
ret = pretty_format_json([get_resource_path('ok_yaml.yaml')])