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 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 test_no_more_than_one_move_at_a_minimum(self): self.server_proxy.move("robocop", 10) time1 = datetime.now() self.server_proxy.move("robocop", 12) time2 = datetime.now() assert_that( (time2 - time1).microseconds, greater_than_or_equal_to(200))
def assert_that_output_matches_more_than(self, regex, times): """Assert that the output matches a given regular expression a specified number of times.""" assert_that(self.owtf_output, matches_regexp(regex)) if times is not None: times_replaced = self._get_number_of_occurences_for(regex) assert_that(times_replaced, greater_than_or_equal_to(times))
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 testComparesObjectsForGreaterThanOrEqualTo(self): self.assert_matches("match", greater_than_or_equal_to(1), 2) self.assert_matches("match", greater_than_or_equal_to(1), 1) self.assert_does_not_match("no match", greater_than_or_equal_to(1), 0)
def step(context): context.json_data = json.loads(context.response.text) context.logger.debug("What's in context json:%s" % context.json_data) context.logger.debug("JSON data is: %s" % context.json_data['data']) assert_that(len(context.json_data[u'data']), greater_than_or_equal_to(0))
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)) )