aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xjson_diff.py2
-rw-r--r--test_json_diff.py19
2 files changed, 15 insertions, 6 deletions
diff --git a/json_diff.py b/json_diff.py
index 4f6f495..b7b44fc 100755
--- a/json_diff.py
+++ b/json_diff.py
@@ -32,7 +32,7 @@ import logging
from optparse import OptionParser
__author__ = "Matěj Cepl"
-__version__ = "1.2.2"
+__version__ = "1.2.3"
import locale
diff --git a/test_json_diff.py b/test_json_diff.py
index 377a4cf..ff63e3e 100644
--- a/test_json_diff.py
+++ b/test_json_diff.py
@@ -177,21 +177,28 @@ class TestMainArgsMgmt(unittest.TestCase):
except SystemExit:
save_stdout.seek(0)
sys.stdout = sys.__stdout__
- expected = "Usage:"
- observed = save_stdout.read()
+ expected = "usage:"
+ observed = save_stdout.read().lower()
self.assertEquals(observed[:len(expected)], expected,
- "testing -h usage message")
+ "testing -h usage message" +
+ "\n\nexpected = %s\n\nobserved = %s" %
+ (expected, observed))
def test_args_run_same(self):
save_stdout = StringIO()
sys.stdout = save_stdout
+ cur_loc = locale.getlocale()
+ locale.setlocale(locale.LC_ALL, "cs_CZ.utf8")
res = json_diff.main(["./test_json_diff.py",
"test/old.json", "test/old.json"])
sys.stdout = sys.__stdout__
- self.assertEquals(res, 0, "testing -h usage message")
+ locale.setlocale(locale.LC_ALL, cur_loc)
+ self.assertEquals(res, 0, "comparing same file" +
+ "\n\nexpected = %d\n\nobserved = %d" %
+ (0, res))
def test_args_run_different(self):
save_stdout = StringIO()
@@ -204,7 +211,9 @@ class TestMainArgsMgmt(unittest.TestCase):
sys.stdout = sys.__stdout__
locale.setlocale(locale.LC_ALL, cur_loc)
- self.assertEquals(res, 1, "testing -h usage message")
+ self.assertEqual(res, 1, "comparing different files" +
+ "\n\nexpected = %d\n\nobserved = %d" %
+ (1, res))
if __name__ == "__main__":
unittest.main()