Exemplo n.º 1
0
def test_is_in_success():
    assert_match_success(is_in([1, 2, 3]), 1, "1")
Exemplo n.º 2
0
def test_equal_to_success():
    assert_match_success(equal_to(1), 1, "1")
Exemplo n.º 3
0
def test_has_length_success():
    assert_match_success(has_length(3), "foo", "3")
Exemplo n.º 4
0
def test_less_than_success():
    assert_match_success(less_than(1), 0, "0")
Exemplo n.º 5
0
def test_is_between_success():
    assert_match_success(is_between(1, 3), 2, "2")
Exemplo n.º 6
0
def test_is_false_success():
    assert_match_success(is_false(), False, "false")
Exemplo n.º 7
0
def test_greater_than_success():
    assert_match_success(greater_than(1), 2, "2")
Exemplo n.º 8
0
def test_is_integer_with_arg_success():
    assert_match_success(is_integer(1), 1, "1")
Exemplo n.º 9
0
def test_is_bool_success():
    assert_match_success(is_bool(), True, "true")
Exemplo n.º 10
0
def test_is_float_with_arg_success():
    assert_match_success(is_float(1.2), 1.2, "1.2")
Exemplo n.º 11
0
def test_is_integer_success():
    assert_match_success(is_integer(), 1, "1")
Exemplo n.º 12
0
def test_is_float_success():
    assert_match_success(is_float(), 1.2, "1.2")
Exemplo n.º 13
0
def test_is_dict_with_argument_success():
    assert_match_success(is_dict(has_entry("foo")), {"foo": 1}, "1")
Exemplo n.º 14
0
def test_has_item_success():
    result = assert_match_success(has_item(greater_than(2)), [1, 3], "index 1")
    assert result.index == 1
    assert result.item == 3
Exemplo n.º 15
0
def test_is_str_with_arg_success():
    assert_match_success(is_str("foo"), "foo", "foo")
Exemplo n.º 16
0
def test_is_bool_with_arg_success():
    assert_match_success(is_bool(True), True, "true")
Exemplo n.º 17
0
def test_is_true_success():
    assert_match_success(is_true(), True, "true")
Exemplo n.º 18
0
def test_is_list_success():
    assert_match_success(is_list(), [], "[]")
Exemplo n.º 19
0
def test_not_equal_to_success():
    assert_match_success(not_equal_to(1), 2, "2")
Exemplo n.º 20
0
def test_is_list_with_tuple_success():
    assert_match_success(is_list(), (), "[]")
Exemplo n.º 21
0
def test_greater_than_or_equal_to_success():
    assert_match_success(greater_than_or_equal_to(1), 1, "1")
Exemplo n.º 22
0
def test_is_list_with_arg_success():
    assert_match_success(is_list(has_length(2)), [21, 42], "2")
Exemplo n.º 23
0
def test_less_than_or_equal_to_success():
    assert_match_success(less_than_or_equal_to(1), 1, "1")
Exemplo n.º 24
0
def test_is_dict_success():
    assert_match_success(is_dict(), {}, "{}")
Exemplo n.º 25
0
def test_is_none_success():
    assert_match_success(is_none(), None, "null")
Exemplo n.º 26
0
def test_is_str_success():
    assert_match_success(is_str(), "foo", "foo")
Exemplo n.º 27
0
def test_is_not_none_success():
    assert_match_success(is_not_none(), "foo", "foo")
Exemplo n.º 28
0
def test_is_str_with_unicode_success():
    assert_match_success(is_str(), u"ààà", u"ààà")
Exemplo n.º 29
0
def test_has_length_with_matcher_success():
    assert_match_success(has_length(greater_than(2)), "foo", "3")
Exemplo n.º 30
0
def test_has_only_values_success():
    assert_match_success(has_only_values([3, 1, 2]), [1, 2, 3], "got")