示例#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}')
示例#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)
示例#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))
示例#5
0
    def test_display_json_value_no_indent(self):

        value = {'a': 'b'}

        assert_equals(
            scheming_display_json_value(value, indent=None), '{"a": "b"}')
示例#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}')
示例#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"}'
示例#10
0
    def test_display_json_value_default(self):

        value = {"a": "b"}

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