def step_with(name, start, stop, status): return has_properties(name=name, title=name, attrib=all_of( has_entry('start', has_float(greater_than_or_equal_to(start))), has_entry('stop', has_float(less_than_or_equal_to(stop))), has_entry('status', status)))
def step_with(name, start, stop, status): return has_properties( name=name, attrib=all_of( has_entry('start', has_float(greater_than_or_equal_to(start))), has_entry('stop', has_float(less_than_or_equal_to(stop))), has_entry('status', status)))
def testDescribeMismatch(self): self.assert_describe_mismatch("was <0>", greater_than(1), 0) self.assert_describe_mismatch("was <2>", less_than(1), 2) self.assert_describe_mismatch("was <0>", greater_than_or_equal_to(1), 0) self.assert_describe_mismatch("was <2>", less_than_or_equal_to(1), 2)
def testMismatchDescription(self): self.assert_mismatch_description("was <0>", greater_than(1), 0) self.assert_mismatch_description("was <2>", less_than(1), 2) self.assert_mismatch_description("was <0>", greater_than_or_equal_to(1), 0) self.assert_mismatch_description("was <2>", less_than_or_equal_to(1), 2)
def testSuccessfulMatchDoesNotGenerateMismatchDescription(self): self.assert_no_mismatch_description(greater_than(1), 2) self.assert_no_mismatch_description(less_than(1), 0) self.assert_no_mismatch_description(greater_than_or_equal_to(1), 1) self.assert_no_mismatch_description(less_than_or_equal_to(1), 1)
def testHasAReadableDescription(self): self.assert_description("a value greater than <1>", greater_than(1)) self.assert_description("a value greater than or equal to <1>", greater_than_or_equal_to(1)) self.assert_description("a value less than <1>", less_than(1)) self.assert_description("a value less than or equal to <1>", less_than_or_equal_to(1))
def testComparesObjectsForLessThanOrEqualTo(self): self.assert_matches("match", less_than_or_equal_to(1), 0) self.assert_matches("match", less_than_or_equal_to(1), 1) self.assert_does_not_match("no match", less_than_or_equal_to(1), 2)
def test_return_next_cell_in_valid_range(self): for x in range(999): assert_that( self.next_cell_calculator.next(), all_of(greater_than_or_equal_to(0), less_than_or_equal_to(100)) )