Test total ordering comparison of two instances. a, b: Instances to be tested (of same or different type). comp: -1, 0, or 1 indicates that the expected order comparison result for operations that are supported by the classes is a <, ==, or > b. a_met
(self, a, b, comp, a_meth=None, b_meth=None)
| 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. |
| 253 | |
| 254 | a, b: Instances to be tested (of same or different type). |
| 255 | |
| 256 | comp: -1, 0, or 1 indicates that the expected order comparison |
| 257 | result for operations that are supported by the classes is |
| 258 | a <, ==, or > b. |
| 259 | |
| 260 | a_meth, b_meth: Either None, indicating that all rich comparison |
| 261 | methods are available, aa for builtins, or the tuple (subset) |
| 262 | of "eq", "ne", "lt", "le", "gt", and "ge" that are available |
| 263 | for the corresponding instance (of a user-defined class). |
| 264 | """ |
| 265 | self.assert_eq_subtest(a, b, comp, a_meth, b_meth) |
| 266 | self.assert_ne_subtest(a, b, comp, a_meth, b_meth) |
| 267 | self.assert_lt_subtest(a, b, comp, a_meth, b_meth) |
| 268 | self.assert_le_subtest(a, b, comp, a_meth, b_meth) |
| 269 | self.assert_gt_subtest(a, b, comp, a_meth, b_meth) |
| 270 | self.assert_ge_subtest(a, b, comp, a_meth, b_meth) |
| 271 | |
| 272 | # The body of each subtest has form: |
| 273 | # |
no test coverage detected