Assert equality result and that ordering is not implemented. a, b: Instances to be tested (of same or different type). equal: Boolean indicating the expected equality comparison results.
(self, a, b, equal)
| 222 | return instances |
| 223 | |
| 224 | def assert_equality_only(self, a, b, equal): |
| 225 | """Assert equality result and that ordering is not implemented. |
| 226 | |
| 227 | a, b: Instances to be tested (of same or different type). |
| 228 | equal: Boolean indicating the expected equality comparison results. |
| 229 | """ |
| 230 | self.assertEqual(a == b, equal) |
| 231 | self.assertEqual(b == a, equal) |
| 232 | self.assertEqual(a != b, not equal) |
| 233 | self.assertEqual(b != a, not equal) |
| 234 | with self.assertRaisesRegex(TypeError, "not supported"): |
| 235 | a < b |
| 236 | with self.assertRaisesRegex(TypeError, "not supported"): |
| 237 | a <= b |
| 238 | with self.assertRaisesRegex(TypeError, "not supported"): |
| 239 | a > b |
| 240 | with self.assertRaisesRegex(TypeError, "not supported"): |
| 241 | a >= b |
| 242 | with self.assertRaisesRegex(TypeError, "not supported"): |
| 243 | b < a |
| 244 | with self.assertRaisesRegex(TypeError, "not supported"): |
| 245 | b <= a |
| 246 | with self.assertRaisesRegex(TypeError, "not supported"): |
| 247 | b > a |
| 248 | with self.assertRaisesRegex(TypeError, "not supported"): |
| 249 | b >= a |
| 250 | |
| 251 | def assert_total_order(self, a, b, comp, a_meth=None, b_meth=None): |
| 252 | """Test total ordering comparison of two instances. |
no test coverage detected