Пример #1
0
def add_a_new_environment_type_with_name_foo(step, env_type_name):
    post_payload = post_data.get_submit_environment(env_type_name)
    headers = {'content-Type':'text/xml',
               "Content-Length": "%d" % len(post_payload) }

    world.conn.request("POST", add_params(world.path_environmenttypes), "", headers)
    world.conn.send(post_payload)
    response = world.conn.getresponse()
    assert_equal(response.status, 200, "create new environment type")
Пример #2
0
def add_environment_foo_to_product_bar(step, environment, product):
    # this takes 2 requests.  
    #    1: get the id of this product
    #    2: add the environment to the product
    
    # fetch the product's resource identity
    product_id = get_product_resid(product)
    
    post_payload = post_data.get_submit_environment(environment)
    headers = {'content-Type':'text/xml',
               'Content-Length': "%d" % len(post_payload) }

    world.conn.request("POST", add_params(world.path_products + product_id + "/environments"), "", headers)
    world.conn.send(post_payload)
    response = world.conn.getresponse()
    assert_equal(response.status, 200, "post new environment to product")
Пример #3
0
def add_environment_foo_to_test_case_bar(step, environment, test_case):
    # this takes 2 requests.  
    #    1: get the id of this test case
    #    2: add the environment to the test case
    
    # fetch the test case's resource identity
    test_case_id = get_test_case_resid(test_case)
    
    post_payload = post_data.get_submit_environment(environment)
    headers = { 'content-Type':'text/xml',
            "Content-Length": "%d" % len(post_payload) }

    world.conn.request("POST", add_params(world.path_testcases + test_case_id + "/environments"), "", headers)
    world.conn.send(post_payload)
    response = world.conn.getresponse()
    assert_equal(response.status, 200, "post new environment to test_case")