def test_add_unknown_connector_with_ROOT_group(self, clear_data): data = parse_request( "post_connectors", { "$name": random_string(), "$url": "http://" + random_string(), "$groupId": root_group_id() }) response = Session.post(TestConnectors.url, data['request']) print(response.json()) assert response.status_code == 200 clear_data.append(response.json()['rid']) assert equal_schema(response.json(), data['schema'])
def test_edit_tag(send_request, add_one_tag): tag_for_edit = add_one_tag data = parse_request( "put_tag", { "$id": tag_for_edit['id'], "$tag": random_string(), "$position": "2", "$integrationId": tag_for_edit['positionIntegrations']['1']['id'] }) response = send_request(sesl_tag, data['request'], method="PUT") assert response.status_code == 200 assert equal_schema(response.json(), data['schema'])
def test_edit_conference_users_on_empty(send_request, add_conference): conf = next(add_conference) print(conf) conf_id = conf['id'] data = parse_request('put_conference', {"$id":conf_id, '$name':random_string(), '$description':random_string(), '$users':[]}) response = send_request(URL.svc_conference, method="PUT", data=data['request']) print(response.json()) assert response.status_code == 200 assert equal_schema(response.json(), data['schema'])
def test_add_tag(send_request, add_one_integration, clear_result): integrationId = add_one_integration['id'] data = parse_request( "post_tag", { "$tag": random_string(), "$position": str(random.randint(3, 99)), "$integrationId": integrationId }) response = send_request(sesl_tag, data['request']) assert response.status_code == 200 clear_result['url'], clear_result['id'] = sesl_tag, response.json()['id'] assert equal_schema(response.json(), data['schema'])
def test_edit_mapping(send_request, add_one_map): existing_mapping = add_one_map data = parse_request( "put_mapfield", { "$databaseColumn": random_string(), "$mapfieldId": existing_mapping['id'], "$title": random_string(), "$position": random.randint(3, 999) }) response = send_request(sesl_mapfield, data['request'], method="PUT") assert response.status_code == 200 assert equal_schema(response.json(), data['schema'])
def test_add_mapping(send_request, add_one_integration): exitsting_integration = add_one_integration data = parse_request( "post_mapfield", { "$databaseColumn": random_string(), "$title": random_string(), "$position": 1, "$integrationId": exitsting_integration['id'] }) response = send_request(sesl_mapfield, data['request']) assert response.status_code == 200 assert equal_schema(response.json(), data['schema'])
def test_edit_connector(self, connector, immutable_group_with_child): group_id = immutable_group_with_child['groupId'] data = parse_request( "put_connectors", { "$rid": connector['rid'], "$name": random_string(), "$url": "http://" + random_string(), "$groupId": group_id }) response = Session.put(TestConnectors.url, data['request']) print(response.json()) assert response.status_code == 200 assert equal_schema(response.json(), data['schema'])
def test_edit_tag_on_existitng_integrationId(send_request, add_two_tags): exist_integratioId = next(add_two_tags)['positionIntegrations']['1']['id'] exist_tag = next(add_two_tags) data = parse_request( "put_tag", { "$id": exist_tag['id'], "$tag": random_string(), "$position": "2", "$integrationId": exist_integratioId }) response = send_request(sesl_tag, data['request'], method="PUT") assert response.status_code == 200 assert equal_schema(response.json(), data['schema'])
def test_add_integration(send_request, clear_result): data = parse_request('post_integration', data={ '$name': random_string(), '$url': random_string(), '$login': random_string(), '$password': random_string() }) response = send_request(url=sesl_integration, data=data['request']) assert response.status_code == 200 clear_result['url'], clear_result['id'] = sesl_integration, response.json( )['id'] assert equal_schema(response.json(), data['schema'])
def test_edit_conference(send_request, get_users, add_conference): users = get_users["cms_user"] conf = next(add_conference) print("CONF______", conf) conf_id = conf['id'] data = parse_request('put_conference', {"$id":conf_id, '$name':random_string(), '$description':random_string(), '$users':users}) print("DATA", data) response = send_request(URL.svc_conference, method="PUT", data=data['request']) print(response.json()) assert response.status_code == 200 assert equal_schema(response.json(), data['schema'])
def test_edit_integration(send_request, add_one_integration): integrationId = add_one_integration['id'] data = parse_request('put_integration', data={ '$integrationId': integrationId, '$name': random_string(), '$url': random_string(), '$login': random_string(), '$password': random_string() }) response = send_request(url=sesl_integration, data=data['request'], method="PUT") assert response.status_code == 200 assert equal_schema(response.json(), data['schema'])
def test_add_template(send_request, add_criteria, delete_template): criteriaId = next(add_criteria)['id'] data = parse_request("post_template", {"$supervisorId":ROOT_user_id, "$name":random_string(), "$version":str(random.randint(1,10)), "$description":random_string(), "$criteriaId":criteriaId, "$weight":random.randint(1,100), "$criteriaPosition":1, "$section_name":random_string(), "$approvalPolicy":"STANDARD", "$templateCriteriaPosition":1 }) response = send_request(URL.edit_template, data['request']) assert response.status_code == 200 delete_template['templateId'] = response.json()['id'] assert equal_schema(response.json(), data['schema'])