class TestCaseGrantController(testtools.TestCase):

    def setUp(self):
        super(TestCaseGrantController, self).setUp()
        os.environ.data['OS_AUTH_URL'] = '127.0.0.23'
        os.environ.data['OS_PORT'] = '5000'
        os.environ.data['OS_VERSION'] = 'v3'
        os.environ.data['OS_TOKEN'] = 'token'
        self.controller = ControllerClient(mock.MagicMock(),"/pre/resources")


    @mock.patch.object(OpenStackDriver, "index")
    def test_index(self, m_index):
        result = self.controller.index(None)
        self.assertIsNotNone(result)

    @mock.patch.object(OpenStackDriver, "create")
    def test_create(self, m_create):
        result = self.controller.create(None)
        self.assertIsNotNone(result)

    @mock.patch.object(OpenStackDriver, "delete")
    def test_create(self, m_create):
        parameters =[{'id':'78934'}]
        result = self.controller.delete(parameters)
        self.assertIsNotNone(result)
 def setUp(self):
     super(TestCaseGrantController, self).setUp()
     os.environ.data['OS_AUTH_URL'] = '127.0.0.23'
     os.environ.data['OS_PORT'] = '5000'
     os.environ.data['OS_VERSION'] = 'v3'
     os.environ.data['OS_TOKEN'] = 'token'
     self.controller = ControllerClient(mock.MagicMock(),"/pre/resources")