sgmock.unittest

class sgmock.unittest.TestCase(methodName='runTest')

Extensions to unittest.TestCase which understand entities, and backport many methods from Python2.7.

assertSameEntity(a, b, msg=None)

Assert that the two given entities refer to the same object.

E.g.: Both are dicts and their types and ids match.

assertNotSameEntity(a, b, msg=None)

Assert that the two given entities do not refer to the same object.

E.g.: Both are dicts and their types and ids do not match.

assertIs(expr1, expr2, msg=None)[source]

Just like self.assertTrue(a is b), but with a nicer default message.

assertIsNot(expr1, expr2, msg=None)[source]

Just like self.assertTrue(a is not b), but with a nicer default message.

assertIsNone(obj, msg=None)[source]

Same as self.assertTrue(obj is None), with a nicer default message.

assertIsNotNone(obj, msg=None)[source]

Included for symmetry with assertIsNone.

assertIn(member, container, msg=None)[source]

Just like self.assertTrue(a in b), but with a nicer default message.

assertNotIn(member, container, msg=None)[source]

Just like self.assertTrue(a not in b), but with a nicer default message.

assertIsInstance(obj, cls, msg=None)[source]

Same as self.assertTrue(isinstance(obj, cls)), with a nicer default message.

assertNotIsInstance(obj, cls, msg=None)[source]

Included for symmetry with assertIsInstance.