예제 #1
0
    def test_subclass(self):
        res = t.Subclass(type)
        self.assertEqual(repr(res), '<Subclass(type)>')
        c = t.Subclass[type]

        class Type(type):
            pass

        res = c.check(Type)
        self.assertEqual(res, Type)
        res = extract_error(c, object)
        self.assertEqual(res, 'value is not subclass of type')
예제 #2
0
 def test_repr(self):
     res = t.Subclass(type)
     assert repr(res) == '<Subclass(type)>'