示例#1
0
    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"))
示例#2
0
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'))
示例#3
0
    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"))
示例#4
0
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))
示例#7
0
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))
示例#10
0
 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))
示例#11
0
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))
示例#12
0
def step(context, full_url):
    actual_url = context.base.get_current_url()
    assert_that(actual_url, contains_string(full_url))
示例#13
0
def step(context, html_text):
    assert_that(context.response.text, is_not(contains_string(html_text)))
示例#14
0
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'))
示例#15
0
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))
示例#16
0
def step_impl(context, retirement_age):
    result = context.base.get_age_choice_result()
    assert_that(result, contains_string(retirement_age))
示例#17
0
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))
示例#18
0
def step_impl(context, retirement_age):
    result = context.base.get_age_choice_result()
    assert_that(result, contains_string(retirement_age))
示例#19
0
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'))
示例#21
0
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))
示例#22
0
def step(context, search_term):
    actual_url = context.base.get_current_url()
    assert_that(actual_url, contains_string(search_term))
示例#23
0
def step(context, relative_url, page_title):
    title = context.base.switch_to_new_tab(relative_url)
    assert_that(title, contains_string(page_title))
示例#24
0
def step(context):
    actual_text = context.rate_checker.get_range_alert()
    assert_that(actual_text, contains_string(RANGE_ALERT_TEXT))
示例#25
0
def step(context, page_anchor):
    current_url = context.base.get_current_url()
    assert_that(current_url, contains_string(page_anchor))
示例#26
0
def matcher(request):
    return contains_string(request.param)
示例#27
0
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)))
示例#29
0
def step(context, page_anchor):
    current_url = context.base.get_current_url()
    assert_that(current_url, contains_string(page_anchor))
示例#30
0
def matcher(request):
    return contains_string(request.param)
示例#31
0
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))
示例#32
0
 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))
示例#33
0
def testMatcherCreationRequiresString():
    with pytest.raises(TypeError):
        contains_string(3)
示例#34
0
def step(context, html_text):
    assert_that(context.response.text, is_not(contains_string(html_text)))
示例#35
0
 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))
示例#36
0
 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))
示例#37
0
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)))
示例#40
0
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))