unittest: Implement assertIs.

pull/118/head
Paul Sokolovsky 2014-05-12 03:04:36 +03:00
rodzic 35d4ae900b
commit e93bb50f5f
2 zmienionych plików z 9 dodań i 2 usunięć

Wyświetl plik

@ -1,7 +1,7 @@
from distutils.core import setup
setup(name='micropython-unittest',
version='0.0.4',
version='0.0.5',
description='Reimplementation of unittest package for MicroPython',
url='https://github.com/micropython/micropython/issues/405',
author='MicroPython Developers',

Wyświetl plik

@ -4,7 +4,14 @@ class TestCase:
assert False, msg
def assertEqual(self, x, y, msg=''):
assert x == y, "%r vs (expected) %r" % (x, y)
if not msg:
msg = "%r vs (expected) %r" % (x, y)
assert x == y, msg
def assertIs(self, x, y, msg=''):
if not msg:
msg = "%r is not %r" % (x, y)
assert x is y, msg
def assertTrue(self, x, msg=''):
assert x, msg