Exemplo n.º 1
0
 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'])
Exemplo n.º 2
0
 def test_edit_connector_without_URL(self, connector):
     data = parse_request(
         "put_connectors", {
             "$rid": connector['rid'],
             "$name": random_string(),
             "$url": None,
             "$groupId": root_group_id()
         })
     response = Session.put(TestConnectors.url, data['request'])
     print(response.json())
     expected_response = {
         'SMC_VALIDATION_CONNECTOR_URL': "Connector url mustn't be empty"
     }
     assert (response.status_code, response.json()) == (400,
                                                        expected_response)
Exemplo n.º 3
0
 def test_edit_connector_with_random_rid(self):
     random_rid = random_string()
     data = parse_request(
         "put_connectors", {
             "$rid": random_rid,
             "$name": random_string(),
             "$url": "http://" + random_string(),
             "$groupId": root_group_id()
         })
     response = Session.put(TestConnectors.url, data['request'])
     print(response.json())
     expected_response = {
         'UNMAPPED_EXCEPTION':
         'SMCRequestException: Connector with rid=%s not found' % random_rid
     }
     assert (response.status_code, response.json()) == (500,
                                                        expected_response)