def test_service_create_duplicate_json(self):
     resp, _content = utils.create_service(self.test_service, str(self.auth_token))
     resp_val = int(resp['status'])
     self.assertEqual(201, resp_val)
     resp, _content = utils.create_service(self.test_service, str(self.auth_token))
     resp_val = int(resp['status'])
     self.assertEqual(409, resp_val)
     utils.delete_service(self.test_service, self.auth_token)
Beispiel #2
0
    def test_service_which_has_dependencies_delete(self):
        resp, _content = utils.create_service(
            self.test_service, str(self.auth_token))
        resp, _content = utils.create_role_mapped_to_service(
            self.test_service + ":test_role",
            self.auth_token, self.test_service)
        self.assertEqual(201, int(resp['status']))
        resp, _content = utils.create_role_ref(
            self.user, self.test_service +
            ":test_role", self.tenant, self.auth_token)
        self.assertEqual(201, int(resp['status']))
        resp, _content = utils.create_endpoint_template(\
            'DFW', self.test_service, 'public_url',\
            'admin_url', 'internal_url', True, False, self.auth_token)
        self.assertEqual(201, int(resp['status']))

        #verify content
        obj = json.loads(_content)
        if not "endpointTemplate" in obj:
            raise fault.BadRequestFault("Expecting endpointTemplate")
        endpoint_template = obj["endpointTemplate"]
        if not "id" in endpoint_template:
            endpoint_template_id = None
        else:
            endpoint_template_id = endpoint_template["id"]
        resp, _content = utils.create_endpoint_xml(self.tenant,
            endpoint_template_id,
            str(self.auth_token))
        resp_val = int(resp['status'])
        self.assertEqual(201, resp_val)

        resp, _content = utils.delete_service(
            self.test_service, self.auth_token)
        resp_val = int(resp['status'])
        self.assertEqual(204, resp_val)
Beispiel #3
0
 def tearDown(self):
     utils.delete_user(self.user, self.auth_token)
     utils.delete_tenant(self.tenant, self.auth_token)
     utils.delete_service(self.sample_service, str(self.auth_token))
Beispiel #4
0
 def test_service_delete_json_using_disabled_token(self):
     resp, _content = utils.delete_service(
         self.test_service, str(self.disabled_token))
     resp_val = int(resp['status'])
     self.assertEqual(403, resp_val)
Beispiel #5
0
 def test_service_delete(self):
     resp, _content = utils.delete_service(
         self.test_service, self.auth_token)
     resp_val = int(resp['status'])
     self.assertEqual(204, resp_val)