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_add_connector_with_empty_url(self): data = parse_request("post_connectors", { "$name": random_string(), "$url": None, "$groupId": root_group_id() }) response = Session.post(TestConnectors.url, data['request']) print(response.json()) expected_result = { 'SMC_VALIDATION_CONNECTOR_URL': "Connector url mustn't be empty" } assert (response.status_code, response.json()) == (400, expected_result)
def test_add_connector_without_group(self): data = parse_request( "post_connectors", { "$name": random_string(), "$url": "http://" + random_string(), "$groupId": None }) response = Session.post(TestConnectors.url, data['request']) print(response.json()) expected_result = { 'SMC_VALIDATION_CONNECTOR_GROUP': "Connector group mustn't be empty" } assert (response.status_code, response.json()) == (400, expected_result)
def test_add_connector_with_existing_URL(self, connector): existing_url = connector['url'] data = parse_request( "post_connectors", { "$name": random_string(), "$url": existing_url, "$groupId": root_group_id() }) response = Session.post(TestConnectors.url, data['request']) print(response.json()) expected_result = { 'SMC_VALIDATION_CONNECTOR_URL_UNIQUE': "Connector url must be unique" } assert (response.status_code, response.json()) == (400, expected_result)