Ejemplo n.º 1
0
 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'])
Ejemplo n.º 2
0
 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)
Ejemplo n.º 3
0
 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)
Ejemplo n.º 4
0
 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)