14. unittest Assert Methods - naveens33/selenium_python GitHub Wiki
The TestCase class provides several assert methods to check for and report failures. The following are the most commonly used methods:
* assertEqual(first, second, msg=None)
Test that first and second are equal. If the values do not compare equal, the test will fail.
* assertNotEqual(first, second, msg=None)
Test that first and second are not equal. If the values do compare equal, the test will fail.
* assertTrue(expr, msg=None)
* assertFalse(expr, msg=None)
Test that expr is true (or false).
* assertIs(first, second, msg=None)
* assertIsNot(first, second, msg=None)
Test that first and second evaluate (or don’t evaluate) to the same object.
* assertIsNone(expr, msg=None)
* assertIsNotNone(expr, msg=None)
Test that expr is (or is not) None.
* assertIn(first, second, msg=None)
* assertNotIn(first, second, msg=None)
Test that first is (or is not) in second.
* assertIsInstance(obj, cls, msg=None)
* assertNotIsInstance(obj, cls, msg=None)
Test that obj is (or is not) an instance of cls (which can be a class or a tuple of classes, as supported by
isinstance()). To check for the exact type, use assertIs(type(obj), cls).