Message227588
Here are most popular idioms which deserve special assertion methods:
assertHasAttr(obj, name) == assertTrue(hasattr(obj, name))
assertIsSubclass(type, expected) == assertTrue(issubclass(type, expected))
assertTypeIs(obj, expected) == assertIs(type(obj), expected)
assertTypedEqual(actual, expected) == assertIs(type(actual), type(expected)) and assertEqual(actual, expected) # or assertIsInstance(actual, type(expected))?
assertStartsWith(actual, prefix) == assertTrue(s.startswith(prefix))
assertEndsWith(actual, suffix) == assertTrue(s.endswith(suffix))
assertUnorderedSequenceEqual(first, second) == assertTrue(all(x in second for x in first)) and assertTrue(all(x in first for x in second)) and assertEqual(len(first), len(second)) |
|
Date |
User |
Action |
Args |
2014-09-26 07:13:28 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, ncoghlan, rbcollins, eric.araujo, r.david.murray, michael.foord, Julian, martin.panter, Gregory.Salvan |
2014-09-26 07:13:28 | serhiy.storchaka | set | messageid: <1411715608.7.0.239902102803.issue19645@psf.upfronthosting.co.za> |
2014-09-26 07:13:28 | serhiy.storchaka | link | issue19645 messages |
2014-09-26 07:13:28 | serhiy.storchaka | create | |
|