def test_create_new_space(self):
     # Design the URL
     api = "api/spaces"
     url = launch_detail.create_url(api)
     space_name = helpers.create_space_name()
     f = helpers.read_post_data_file('create_space_sdd.json',
                                     replace={
                                         '$space_name_var':
                                         space_name,
                                         '$loggedin_user_id':
                                         dynamic_vars.userid
                                     })
     # Make the request
     r = req.post(url, headers=request_detail.headers_default, json=f)
     # Analyze the response
     global spaceid, spacename
     spaceid = helpers.extract_value("data.id", r)
     spacename = helpers.extract_value("data.attributes.name", r)
     spacelink = helpers.extract_value("data.links.self", r)
     content_type_header = helpers.extract_header("Content-Type", r)
     print("\nSpace created : ", spacename)
     # Save and retain dynamic data for later use
     dynamic_vars.spaceid = spaceid
     dynamic_vars.spacename = spacename
     dynamic_vars.spacelink = spacelink
     # Validate the response
     assert r.status_code == 201
     assert content_type_header == request_detail.content_type_default
     assert helpers.extract_value("data.type", r) == 'spaces'
 def test_enable_experimental_features(self):
     # Design the URL
     api = "api/users"
     url = launch_detail.create_url(api)
     f = helpers.read_post_data_file(
         'enable_experimental.json',
         replace={'$loggedin_user_id': dynamic_vars.userid})
     # Make the request
     r = req.patch(url, headers=request_detail.headers_default, json=f)
     # Validate the response
     assert r.status_code == 200
 def test_create_child_areas(self, area_name):
     # Design the URL
     api = "api/areas/" + dynamic_vars.parent_area_id
     url = launch_detail.create_url(api)
     f = helpers.read_post_data_file(
         'create_child_area.json',
         replace={'$area_name_generated': area_name})
     # Make the request
     r = req.post(url, headers=request_detail.headers_default, json=f)
     # Analyze the response
     dynamic_vars.area_names_to_ids[area_name] = helpers.extract_value(
         "data.id", r)
     # Validate the response
     assert r.status_code == 201
示例#4
0
 def test_create_child_iters(self, iter_name):
     #Design the URL
     api = "api/iterations/" + dynamic_vars.parent_iteration_id
     url = launch_detail.create_url(api)
     f = helpers.read_post_data_file('create_child_iteration.json',
                                     replace={
                                         '$iteration_name_generated':
                                         iter_name,
                                         '$spaceid': spaceid
                                     })
     ##Make the request
     r = req.post(url, headers=request_detail.headers_default, json=f)
     ##Analyze the response
     dynamic_vars.iteration_names_to_ids[iter_name] = helpers.extract_value(
         "data.id", r)
     ##Validate the response
     assert r.status_code == 201