Exemplo n.º 1
0
def test_is_json_failure():
    assert_match_failure(is_json({"foo": 1, "bar": 2}), {"foo": 1, "bar": 2, "baz": 3}, '+    "baz": 3')
Exemplo n.º 2
0
def test_has_item_failure():
    result = assert_match_failure(has_item(greater_than(2)), [1, 2],
                                  "no matching")
    assert result.index == -1
    assert result.item is None
Exemplo n.º 3
0
def test_is_text_failure():
    assert_match_failure(is_text("foo\nbar"), "foo\nbar\nbaz", "+baz")
Exemplo n.º 4
0
def test_match_pattern_failure_invalid_type():
    assert_match_failure(match_pattern("^f"), None, "Invalid value")
Exemplo n.º 5
0
def test_match_pattern_failure():
    assert_match_failure(match_pattern("^f"), "bar", "bar")
Exemplo n.º 6
0
def test_contains_string_with_failure():
    assert_match_failure(contains_string("ob"), "baz", "baz")
Exemplo n.º 7
0
def test_ends_with_failure():
    assert_match_failure(ends_with("foo"), "bar", "bar")