Esempio n. 1
0
    def test_display_json_value_keys_are_sorted(self):

        value = {'c': 'd', 'a': 'b'}

        assert_equals(
                scheming_display_json_value(value, indent=4),
                '{\n    "a": "b", \n    "c": "d"\n}')
Esempio n. 2
0
    def test_display_json_value_indent(self):

        value = {"a": "b"}

        assert (
            scheming_display_json_value(value, indent=4)
            == '{\n    "a": "b"\n}'
        )
    def test_display_json_value_keys_are_sorted(self):

        value = {"c": "d", "a": "b"}
        if six.PY3:
            expected = '{\n    "a": "b",\n    "c": "d"\n}'
        else:
            expected = '{\n    "a": "b", \n    "c": "d"\n}'

        assert (scheming_display_json_value(value, indent=4) == expected)
Esempio n. 4
0
    def test_display_json_value_json_error(self):

        date = datetime.datetime.now()
        value = ('a', date)

        assert_equals(scheming_display_json_value(value), ('a', date))
Esempio n. 5
0
    def test_display_json_value_no_indent(self):

        value = {'a': 'b'}

        assert_equals(
            scheming_display_json_value(value, indent=None), '{"a": "b"}')
Esempio n. 6
0
    def test_display_json_value_indent(self):

        value = {'a': 'b'}

        assert_equals(
            scheming_display_json_value(value, indent=4), '{\n    "a": "b"\n}')
Esempio n. 7
0
    def test_display_json_value_default(self):

        value = {'a': 'b'}

        assert_equals(scheming_display_json_value(value), '{\n  "a": "b"\n}')
    def test_display_json_value_json_error(self):

        date = datetime.datetime.now()
        value = ("a", date)

        assert scheming_display_json_value(value) == ("a", date)
    def test_display_json_value_no_indent(self):

        value = {"a": "b"}

        assert scheming_display_json_value(value, indent=None) == '{"a": "b"}'
Esempio n. 10
0
    def test_display_json_value_default(self):

        value = {"a": "b"}

        assert scheming_display_json_value(value) == '{\n  "a": "b"\n}'