kopia lustrzana https://github.com/micropython/micropython-lib
unittest: Implement assertIs.
rodzic
35d4ae900b
commit
e93bb50f5f
|
@ -1,7 +1,7 @@
|
||||||
from distutils.core import setup
|
from distutils.core import setup
|
||||||
|
|
||||||
setup(name='micropython-unittest',
|
setup(name='micropython-unittest',
|
||||||
version='0.0.4',
|
version='0.0.5',
|
||||||
description='Reimplementation of unittest package for MicroPython',
|
description='Reimplementation of unittest package for MicroPython',
|
||||||
url='https://github.com/micropython/micropython/issues/405',
|
url='https://github.com/micropython/micropython/issues/405',
|
||||||
author='MicroPython Developers',
|
author='MicroPython Developers',
|
||||||
|
|
|
@ -4,7 +4,14 @@ class TestCase:
|
||||||
assert False, msg
|
assert False, msg
|
||||||
|
|
||||||
def assertEqual(self, x, y, 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=''):
|
def assertTrue(self, x, msg=''):
|
||||||
assert x, msg
|
assert x, msg
|
||||||
|
|
Ładowanie…
Reference in New Issue