예제 #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")))
예제 #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))
예제 #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'))
예제 #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))
예제 #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))
예제 #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))
예제 #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)))
예제 #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))
예제 #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)))
예제 #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))