kopia lustrzana https://github.com/micropython/micropython-lib
unittest: Add assertLessEqual, assertGreaterEqual methods.
As used by CPython testsuite.pull/488/head
rodzic
a57b575020
commit
dedfe2dcd4
|
@ -43,6 +43,16 @@ class TestCase:
|
||||||
msg = "%r not expected to be equal %r" % (x, y)
|
msg = "%r not expected to be equal %r" % (x, y)
|
||||||
assert x != y, msg
|
assert x != y, msg
|
||||||
|
|
||||||
|
def assertLessEqual(self, x, y, msg=None):
|
||||||
|
if msg is None:
|
||||||
|
msg = "%r is expected to be <= %r" % (x, y)
|
||||||
|
assert x <= y, msg
|
||||||
|
|
||||||
|
def assertGreaterEqual(self, x, y, msg=None):
|
||||||
|
if msg is None:
|
||||||
|
msg = "%r is expected to be >= %r" % (x, y)
|
||||||
|
assert x >= y, msg
|
||||||
|
|
||||||
def assertAlmostEqual(self, x, y, places=None, msg="", delta=None):
|
def assertAlmostEqual(self, x, y, places=None, msg="", delta=None):
|
||||||
if x == y:
|
if x == y:
|
||||||
return
|
return
|
||||||
|
|
Ładowanie…
Reference in New Issue