unittest: Add dummy implementation (just a TestCase class with few methods).

asyncio-segfault
Paul Sokolovsky 2014-04-02 00:19:21 +03:00
rodzic 78fd8376d1
commit 9526ae8e7c
1 zmienionych plików z 25 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,25 @@
class TestCase:
def fail(self, msg):
assert False, msg
def assertEqual(self, x, y):
assert x == y, "%r vs %r" % (x, y)
def assertTrue(self, x):
assert x
def assertIn(self, x, y):
assert x in y
def assertIsInstance(self, x, y):
assert isinstance(x, y)
def assertRaises(self, exc, func, *args):
try:
func(*args)
assert False, "%r not raised" % exc
except Exception as e:
if isinstance(e, exc):
return
raise