python unit test new Flashcards
perform unit test
assertEqual(a, b)
a == b
assertTrue(x)
bool(x) is True
assertIs(a, b)
a is b
assertIn(a, b)
a in b
assertIsInstance(a, b)
isinstance(a, b)
AssertEqual
(first, second, msg=None)
Test that first and second are equal. If the values do not compare equal, the test will fail.
In addition, if first and second are the exact same type and one of list, tuple, dict, set, frozenset or str or any type that a subclass registers with addTypeEqualityFunc() the type-specific equality function will be called in order to generate a more useful default error message (see also the list of type-specific methods).
assertTrue(expr, msg=None)
Test that expr is true (or false).
**testing method to check if calculation is true or false
assertIs(first, second, msg=None)
Test that first and second are equal. If the values do compare not equal, the test will fail.
assertIn(member, container, msg=None)
Test that member is (or is not) in container.
** assertin method to see if an item is within a list of items
assertisinstance
assertisinstance testing method if an object is instance of a class