Example #1
0
def test_is_writes_str_of_non_matching_values_to_mismatch_output():
    mismatch_output = []
    is_("{}").matches("Hello!", mismatch_output)
    assert_equals(["got: Hello!"], mismatch_output)
Example #2
0
def test_is_str_uses_value_str():
    assert_equals(str(is_("Blah")), "<is: Blah>")
Example #3
0
def test_is_does_not_write_to_mismatch_output_if_it_matches():
    m = {}
    mismatch_output = []
    assert is_(None).matches(None, mismatch_output)
    assert is_(m).matches(m, mismatch_output)
    assert not mismatch_output
Example #4
0
def test_is_uses_is_operator():
    assert is_(None).matches(None, [])
    m = {}
    assert is_(m).matches(m, [])
    assert not is_({}).matches({}, [])