Exemple #1
0
def test_is_json_failure():
    assert_match_failure(is_json({"foo": 1, "bar": 2}), {"foo": 1, "bar": 2, "baz": 3}, '+    "baz": 3')
Exemple #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
Exemple #3
0
def test_is_text_failure():
    assert_match_failure(is_text("foo\nbar"), "foo\nbar\nbaz", "+baz")
Exemple #4
0
def test_match_pattern_failure_invalid_type():
    assert_match_failure(match_pattern("^f"), None, "Invalid value")
Exemple #5
0
def test_match_pattern_failure():
    assert_match_failure(match_pattern("^f"), "bar", "bar")
Exemple #6
0
def test_contains_string_with_failure():
    assert_match_failure(contains_string("ob"), "baz", "baz")
Exemple #7
0
def test_ends_with_failure():
    assert_match_failure(ends_with("foo"), "bar", "bar")