def test_make_init_url(self): url_generator = UrlGenerator("http://fake/") result_url = url_generator.init_url("robocop") assert_that(result_url, contains_string("http://fake/")) assert_that(result_url, contains_string("player=robocop")) assert_that(result_url, contains_string("command=Init"))
def step(context, param_name): context.json_data = json.loads(context.response.text) #context.logger.debug("JSON detail is: %s" % context.json_data['detail']) #context.logger.debug("JSON text is: %s" % context.response.text) assert_that(context.json_data['detail'], contains_string('Required parameter')) assert_that(context.json_data['detail'], contains_string(param_name)) assert_that(context.json_data['detail'], contains_string('is missing'))
def test_make_move_url(self): url_generator = UrlGenerator("http://fake/") result_url = url_generator.move_url("robocop", 30) assert_that(result_url, contains_string("http://fake/")) assert_that(result_url, contains_string("player=robocop")) assert_that(result_url, contains_string("command=Move")) assert_that(result_url, contains_string("position=30"))
def step(context, handle_color): actual_text = context.rate_checker.get_warning_button() # If the element's class name includes 'warning' # Then the button has turned red if (handle_color == 'red'): assert_that(actual_text, contains_string("warning")) # If the element's class name DOES NOT include 'warning' # Then the button has turned green elif (handle_color == 'green'): assert_that(actual_text, is_not(contains_string("warning")))
def step(context, handle_color): actual_text = context.rate_checker.get_warning_button() # If the element's class name includes 'warning' # Then the button has turned red if(handle_color == 'red'): assert_that(actual_text, contains_string("warning")) # If the element's class name DOES NOT include 'warning' # Then the button has turned green elif(handle_color == 'green'): assert_that(actual_text, is_not(contains_string("warning")))
def step(context, expected_page_title): # Verify that the actual page title matches the expected title actual_title = context.base.get_page_title(expected_page_title) assert_that(actual_title, contains_string(expected_page_title))
def step(context, param_name): context.json_data = json.loads(context.response.text) assert_that(context.json_data.get(param_name), is_not(none())) assert_that(context.json_data[param_name][0], contains_string('required'))
def step(context, link_name): # Verify that the page title matches the link we clicked page_title = context.base.get_page_title() assert_that(page_title, contains_string(link_name))
def step(context, relative_url, page_title): title = context.base.switch_to_new_tab(relative_url) assert_that(title, contains_string(page_title))
def assert_that_output_contains(self, substring, times=None): assert_that(self.owtf_output, contains_string(substring)) if times is not None: assert_that(self.owtf_output.count(substring), equal_to(times))
def step(context, link_name): # Verify that the page title matches the link we clicked page_title = context.base.get_page_title() assert_that(page_title, contains_string(link_name))
def step(context, full_url): actual_url = context.base.get_current_url() assert_that(actual_url, contains_string(full_url))
def step(context, html_text): assert_that(context.response.text, is_not(contains_string(html_text)))
def step(context, param_name): context.json_data = json.loads(context.response.text) assert_that(context.json_data.get(param_name), is_not(none())) assert_that(context.json_data[param_name][0], contains_string('required'))
def step(context, expected_result): # Verify that the resulting retirement age appears in the chart result = context.base.get_fra_result() assert_that(result, contains_string(expected_result))
def step_impl(context, retirement_age): result = context.base.get_age_choice_result() assert_that(result, contains_string(retirement_age))
def step(context, expected_result): # Verify that the resulting retirement age appears in the chart result = context.base.get_fra_result() assert_that(result, contains_string(expected_result))
def step_impl(context, retirement_age): result = context.base.get_age_choice_result() assert_that(result, contains_string(retirement_age))
def step(context, html_text): context.json_data = json.loads(context.response.text) context.logger.debug("json_data html_text: %s" % context.json_data) assert_that(context.json_data.get('non_field_errors'), is_not(none())) assert_that(context.json_data['non_field_errors'][0], contains_string(html_text))
def step(context, section_name): caption = context.loan_options.get_expand_button_caption(section_name) assert_that(caption, contains_string('Collapse'))
def step(context, relative_url, page_title): current_page_title = context.base.get_blank_handle_title() assert_that(current_page_title, contains_string(page_title)) actual_url = context.base.get_blank_handle_url() assert_that(actual_url, contains_string(relative_url))
def step(context, search_term): actual_url = context.base.get_current_url() assert_that(actual_url, contains_string(search_term))
def step(context, relative_url, page_title): title = context.base.switch_to_new_tab(relative_url) assert_that(title, contains_string(page_title))
def step(context): actual_text = context.rate_checker.get_range_alert() assert_that(actual_text, contains_string(RANGE_ALERT_TEXT))
def step(context, page_anchor): current_url = context.base.get_current_url() assert_that(current_url, contains_string(page_anchor))
def matcher(request): return contains_string(request.param)
def step(context, full_url): actual_url = context.base.get_current_url() assert_that(actual_url, contains_string(full_url))
def then_the_cti_is_notified_for_a_configuration_change(step): expression = "xivo[cticonfig,update]" log_lines = logs.find_line_in_xivo_sysconfd_log() assert_that(log_lines, has_item(contains_string(expression)))
def step(context, page_anchor): current_url = context.base.get_current_url() assert_that(current_url, contains_string(page_anchor))
def matcher(request): return contains_string(request.param)
def step(context, relative_url, page_title): actual_url = context.base.get_current_url() assert_that(actual_url, contains_string(relative_url)) actual_page_title = context.base.get_page_title() assert_that(actual_page_title, contains_string(page_title))
def assert_that_output_contains(self, substring, times=None): """Assert that the output of the plugin contains the given content.""" assert_that(self.owtf_output, contains_string(substring)) if times is not None: assert_that(self.owtf_output.count(substring), equal_to(times))
def testMatcherCreationRequiresString(): with pytest.raises(TypeError): contains_string(3)
def step(context, html_text): assert_that(context.response.text, is_not(contains_string(html_text)))
def assert_that_output_contains(self, substring, times=None): assert_that(self.owtf_output, contains_string(substring)) if times is not None: assert_that(self.owtf_output.count(substring), equal_to(times))
def assert_that_output_contains(self, substring, times=None): """Assert that the output of the plugin contains the given content.""" assert_that(self.owtf_output, contains_string(substring)) if times is not None: assert_that(self.owtf_output.count(substring), equal_to(times))
def testMatcherCreationRequiresString(): with pytest.raises(TypeError): contains_string(3)
def step(context): actual_text = context.rate_checker.get_range_alert() assert_that(actual_text, contains_string(RANGE_ALERT_TEXT))
def then_the_cti_is_notified_for_a_configuration_change(step): expression = "xivo[cticonfig,update]" log_lines = logs.find_line_in_xivo_sysconfd_log() assert_that(log_lines, has_item(contains_string(expression)))
def step(context, html_text): context.json_data = json.loads(context.response.text) context.logger.debug("json_data html_text: %s" % context.json_data) assert_that(context.json_data.get('non_field_errors'), is_not(none())) assert_that(context.json_data['non_field_errors'][0], contains_string(html_text))