Exemplo n.º 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"))
Exemplo n.º 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'))
Exemplo n.º 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"))
Exemplo n.º 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")))
Exemplo n.º 6
0
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))
Exemplo n.º 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'))
Exemplo n.º 8
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))
Exemplo n.º 9
0
def step(context, relative_url, page_title):
    title = context.base.switch_to_new_tab(relative_url)
    assert_that(title, contains_string(page_title))
Exemplo n.º 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))
Exemplo n.º 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))
Exemplo n.º 12
0
def step(context, full_url):
    actual_url = context.base.get_current_url()
    assert_that(actual_url, contains_string(full_url))
Exemplo n.º 13
0
def step(context, html_text):
    assert_that(context.response.text, is_not(contains_string(html_text)))
Exemplo n.º 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'))
Exemplo n.º 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))
Exemplo n.º 16
0
def step_impl(context, retirement_age):
    result = context.base.get_age_choice_result()
    assert_that(result, contains_string(retirement_age))
Exemplo n.º 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))
Exemplo n.º 18
0
def step_impl(context, retirement_age):
    result = context.base.get_age_choice_result()
    assert_that(result, contains_string(retirement_age))
Exemplo n.º 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))
Exemplo n.º 20
0
def step(context, section_name):
    caption = context.loan_options.get_expand_button_caption(section_name)
    assert_that(caption, contains_string('Collapse'))
Exemplo n.º 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))
Exemplo n.º 22
0
def step(context, search_term):
    actual_url = context.base.get_current_url()
    assert_that(actual_url, contains_string(search_term))
Exemplo n.º 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))
Exemplo n.º 24
0
def step(context):
    actual_text = context.rate_checker.get_range_alert()
    assert_that(actual_text, contains_string(RANGE_ALERT_TEXT))
Exemplo n.º 25
0
def step(context, page_anchor):
    current_url = context.base.get_current_url()
    assert_that(current_url, contains_string(page_anchor))
Exemplo n.º 26
0
def matcher(request):
    return contains_string(request.param)
Exemplo n.º 27
0
def step(context, full_url):
    actual_url = context.base.get_current_url()
    assert_that(actual_url, contains_string(full_url))
Exemplo n.º 28
0
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)))
Exemplo n.º 29
0
def step(context, page_anchor):
    current_url = context.base.get_current_url()
    assert_that(current_url, contains_string(page_anchor))
Exemplo n.º 30
0
def matcher(request):
    return contains_string(request.param)
Exemplo n.º 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))
Exemplo n.º 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))
Exemplo n.º 33
0
def testMatcherCreationRequiresString():
    with pytest.raises(TypeError):
        contains_string(3)
Exemplo n.º 34
0
def step(context, html_text):
    assert_that(context.response.text, is_not(contains_string(html_text)))
Exemplo n.º 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))
Exemplo n.º 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))
Exemplo n.º 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))
Exemplo n.º 39
0
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)))
Exemplo n.º 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))