def test_check__not_eq_for_same_func_desc_diff_version(): obj_1 = versions.Check("Desc {}", operator.lt, 1, 2, 3) obj_2 = versions.Check("Desc {}", operator.lt, 1, 3, 3) assert hash(obj_1) != hash(obj_2) assert obj_1 != obj_2
def test_check__eq_same_func_desc_and_version(): obj_1 = versions.Check("Desc {}", operator.lt, 1, 2, 3) obj_2 = versions.Check("Desc {}", operator.lt, 1, 2, 3) assert hash(obj_1) == hash(obj_2) assert obj_1 == obj_2
def test_check_str(): obj = versions.Check("FooBar", operator.lt, 3, 7, 5) assert str(obj) == "FooBar"
def test_check__func_must_be_callable(): with pytest.raises(TypeError): versions.Check("FooBar", 3, 7, 5)
def test_check__not_eq_for_same_func_desc_diff_version(): obj_1 = versions.Check("Desc {}", operator.lt, 1, 2, 3) obj_2 = versions.Check("Desc {}", operator.lt, 1, 3, 3) assert_not_equal(hash(obj_1), hash(obj_2)) assert_not_equal(obj_1, obj_2)
def test_check_str(): obj = versions.Check("FooBar", operator.lt, 3, 7, 5) assert_equal(str(obj), "FooBar")