예제 #1
0
def integer_is_dumped_as_string():
    assert_equal("1", dumps(1))
예제 #2
0
def long_is_dumped_as_string():
    assert_equal("1", dumps(long(1)))
예제 #3
0
def multiline_dict_value_is_separated_by_newline_from_previous_value():
    assert_equal(
        "two: false\n\none: - 3\n     - 2",
        dumps(OrderedDict([("two", False), ("one", [3, 2])]))
    )
예제 #4
0
def integer_is_dumped_as_string():
    assert_equal("1", dumps(1))
예제 #5
0
def items_in_lists_are_separated_by_blank_line_if_they_are_multiline():
    assert_equal("- - 3\n  - 2\n\n- - 1\n  - 0", dumps([[3, 2], [1, 0]]))
예제 #6
0
def keys_in_dicts_are_right_aligned():
    assert_equal(
        "a-long-key: 1\n     short: 2",
        dumps(OrderedDict([("a-long-key", 1), ("short", 2)]))
    )
예제 #7
0
def items_in_lists_are_separated_by_blank_line_if_they_are_multiline():
    assert_equal("- - 3\n  - 2\n\n- - 1\n  - 0", dumps([[3, 2], [1, 0]]))
예제 #8
0
def lists_are_dumped_with_each_element_on_new_line_preceded_by_hyphen():
    assert_equal("- 3\n- 2\n- 1", dumps([3, 2, 1]))
예제 #9
0
def lists_are_dumped_with_each_element_on_new_line_preceded_by_hyphen():
    assert_equal("- 3\n- 2\n- 1", dumps([3, 2, 1]))
예제 #10
0
def nested_lists_cause_extra_indentation():
    assert_equal("- - 3\n  - 2", dumps([[3, 2]]))
예제 #11
0
def booleans_are_dumped_as_lowercase_string():
    assert_equal("false", dumps(False))
    assert_equal("true", dumps(True))
예제 #12
0
def long_is_dumped_as_string():
    assert_equal("1.2", dumps(1.2))
예제 #13
0
def long_is_dumped_as_string():
    assert_equal("1", dumps(long(1)))
예제 #14
0
def long_is_dumped_as_string():
    assert_equal("1.2", dumps(1.2))
예제 #15
0
def dumping_dicts_separates_key_and_value_with_colon_and_items_with_newlines():
    assert_equal("one: 1\ntwo: 2", dumps(OrderedDict([("one", 1),
                                                      ("two", 2)])))
예제 #16
0
def booleans_are_dumped_as_lowercase_string():
    assert_equal("false", dumps(False))
    assert_equal("true", dumps(True))
예제 #17
0
def keys_in_dicts_are_right_aligned():
    assert_equal("a-long-key: 1\n     short: 2",
                 dumps(OrderedDict([("a-long-key", 1), ("short", 2)])))
예제 #18
0
def nested_lists_cause_extra_indentation():
    assert_equal("- - 3\n  - 2", dumps([[3, 2]]))
예제 #19
0
def values_within_dicts_are_indented_if_they_are_on_multiple_lines():
    assert_equal("one: - 3\n     - 2\n     - 1", dumps({"one": [3, 2, 1]}))
예제 #20
0
def dumping_dicts_separates_key_and_value_with_colon_and_items_with_newlines():
    assert_equal(
        "one: 1\ntwo: 2",
        dumps(OrderedDict([("one", 1), ("two", 2)]))
    )
예제 #21
0
def multiline_dict_value_is_separated_by_newline_from_previous_value():
    assert_equal("two: false\n\none: - 3\n     - 2",
                 dumps(OrderedDict([("two", False), ("one", [3, 2])])))
예제 #22
0
def values_within_dicts_are_indented_if_they_are_on_multiple_lines():
    assert_equal(
        "one: - 3\n     - 2\n     - 1",
        dumps({"one": [3, 2, 1]})
    )
예제 #23
0
def string_is_dumped_as_string_without_quotations():
    assert_equal("hello", dumps("hello"))
예제 #24
0
 def write_result(self, value):
     self._output_file.write(marmoset.dumps(value))
     self._output_file.write("\n")
예제 #25
0
def string_is_dumped_as_string_without_quotations():
    assert_equal("hello", dumps("hello"))