def test_list(): orig = range(10) l = Asserter(orig) l.is_(orig) l.length() == 10 with assert_raises(): l.length() == 9
def test_nested(): orig = Dog(13) obj = Asserter(orig) obj.is_(orig) obj.isinstance(Dog) with assert_raises(): obj.isinstance(int) obj.say() == "woof" with assert_raises(): obj.say() == "quack" obj.age == 13 with assert_raises(): obj.age == 15