Ejemplo n.º 1
0
def test_schema_parse_error_single_item_list():
    with pytest.raises(schema.ParseError) as excinfo:
        schema.parse_items([['word']])
    assert str(excinfo.value) == """
whilst parsing the items: [[{0}'word']]
whilst parsing an item:    [{0}'word']
expected an array with at least two elements; got [{0}'word']""".format(string_prefix)
Ejemplo n.º 2
0
def test_schema_parse_error_single_item_list():
    with pytest.raises(schema.ParseError) as excinfo:
        schema.parse_items([['word']])
    assert str(excinfo.value) == """
whilst parsing the items: [[{0}'word']]
whilst parsing an item:    [{0}'word']
expected an array with at least two elements; got [{0}'word']""".format(
        string_prefix)
Ejemplo n.º 3
0
def test_schema_parse_error_in_non_zeroth_item():
    with pytest.raises(schema.ParseError) as excinfo:
        schema.parse_items([[' ', None]])
    assert str(excinfo.value) == """
whilst parsing the items:       [[{0}' ', None]]
whilst parsing an item:          [{0}' ', None]
whilst parsing character sets:   [{0}' ', None]
whilst parsing a character set:   {1}     None
whilst parsing the value:         {1}     None
expected a string; got None""".format(string_prefix, string_padding)
Ejemplo n.º 4
0
def test_schema_parse_error_in_non_zeroth_item():
    with pytest.raises(schema.ParseError) as excinfo:
        schema.parse_items([[' ', None]])
    assert str(excinfo.value) == """
whilst parsing the items:       [[{0}' ', None]]
whilst parsing an item:          [{0}' ', None]
whilst parsing character sets:   [{0}' ', None]
whilst parsing a character set:   {1}     None
whilst parsing the value:         {1}     None
expected a string; got None""".format(string_prefix, string_padding)
Ejemplo n.º 5
0
def test_schema_parse_error_wrong_type_in_delimiter():
    with pytest.raises(schema.ParseError) as excinfo:
        schema.parse_items([[None, 1]])
    assert str(excinfo.value) == """
Ejemplo n.º 6
0
def test_schema_parse_error_wrong_type_in_delimiter():
    with pytest.raises(schema.ParseError) as excinfo:
        schema.parse_items([[None, 1]])
    assert str(excinfo.value) == """