示例#1
0
def test_json_list_parses_a_list_of_2_ints():
    assert run_parser(json_list(), '[1,2]').value == [1, 2]
示例#2
0
def test_json_list_parses_list_including_spaces():
    assert run_parser(json_list(), '[1,  2 ,3]').value == [1, 2, 3]
示例#3
0
def test_json_list_parses_list_with_one_int_in_it():
    assert run_parser(json_list(), '[1]').value == [1]
示例#4
0
def test_json_list_parses_empty_list_with_5_spaces():
    assert run_parser(json_list(), '[     ]').value == []
示例#5
0
def test_json_list_handles_a_list_of_lists():
    assert (run_parser(json_list(),
                       "[1, [2,3], [],[[]]]").value == [1, [2, 3], [], [[]]])
示例#6
0
def test_json_list_parses_a_list_with_null_in_it():
    assert run_parser(json_list(), '[ null ]').value == [None]
示例#7
0
def test_json_list_parses_list_of_strings_and_ints():
    assert (run_parser(json_list(),
                       '[1, "two", 3, "four"]').value == [1, "two", 3, "four"])