def given_a_created_product_with_name_group1(step, product_id, product_release): body = dict_to_xml(default_product(name=product_id)) response = api_utils.add_new_product(headers=world.headers, body=body) assert_true(response.ok, response.content) world.product_id = response.json()[PRODUCT_NAME] body = dict_to_xml(create_product_release(version=product_release)) response = api_utils.add_product_release(headers=world.headers, body=body, product_id=product_id) assert_true(response.ok, response.content)
def given_a_created_product_with_attributes_and_name_group1(step, product_id): metadatas = create_default_metadata_or_attributes_list(2) body = dict_to_xml(default_product(name=product_id, metadata=metadatas)) response = api_utils.add_new_product(headers=world.headers, body=body) assert_true(response.ok, response.content) world.product_id = response.json()[PRODUCT_NAME]
def given_a_created_product_with_attributes_and_name_group1(step, product_id): attributes = create_default_metadata_or_attributes_list(2) body = dict_to_xml(default_product(name=product_id, attributes=attributes)) response = api_utils.add_new_product(headers=world.headers, body=body) assert_true(response.ok, response.content) world.product_id = response.json()[PRODUCT_NAME]
def given_a_created_product_with_name_group1(step, product_id): world.created_product_body = default_product(name=product_id) body = dict_to_xml(world.created_product_body) response = api_utils.add_new_product(headers=world.headers, body=body) assert_true(response.ok, response.content) world.product_id = response.json()[PRODUCT_NAME]
def when_i_add_the_new_product_with_metadatas_with_accept_parameter_group1_response(step, accept_content): world.headers[ACCEPT_HEADER] = accept_content body = dict_to_xml(product_with_metadata(name=world.product_name, description=world.product_description, metadata=world.metadatas)) world.response = api_utils.add_new_product(headers=world.headers, body=body)
def when_i_add_the_new_product_with_group1_response(step, accept_content): world.headers[ACCEPT_HEADER] = accept_content body = dict_to_xml( simple_product_body(name=world.product_name, description=world.product_description)) world.response = api_utils.add_new_product(headers=world.headers, body=body)
def create_release_product(step, product_release, product_name, accept_content): if product_release == 'LONG_ID': world.product_release = LONG_ID else: world.product_release = product_release world.headers[ACCEPT_HEADER] = accept_content body = dict_to_xml(create_product_release(version=world.product_release)) world.response = api_utils.add_product_release(headers=world.headers, body=body, product_id=product_name)
def when_i_add_the_new_product_with_attributes_with_accept_parameter_group1_response( step, accept_content): world.headers[ACCEPT_HEADER] = accept_content body = dict_to_xml( product_with_attributes(name=world.product_name, description=world.product_description, attributes=world.attributes)) world.response = api_utils.add_new_product(headers=world.headers, body=body)
def when_i_add_the_new_product_with_group1_response(step, accept_content): world.headers[ACCEPT_HEADER] = accept_content body = dict_to_xml(simple_product_body(name=world.product_name, description=world.product_description)) world.response = api_utils.add_new_product(headers=world.headers, body=body)