Example #1
0
    def test_get_test_admin_context(self):
        """get_test_admin_context's return value behaves like admin context"""
        ctxt = test_utils.get_test_admin_context()

        # TODO(soren): This should verify the full interface context
        # objects expose.
        self.assertTrue(ctxt.is_admin)
 def setUp(self):
     super(_VirtDriverTestCase, self).setUp()
     self.connection = self.driver_module.get_connection("")
     self.ctxt = test_utils.get_test_admin_context()
     self.image_service = image.get_default_image_service()
Example #3
0
 def setUp(self):
     super(_VirtDriverTestCase, self).setUp()
     self.connection = self.driver_module.get_connection('')
     self.ctxt = test_utils.get_test_admin_context()
     self.image_service = image.get_default_image_service()
Example #4
0
 def test_get_test_instance(self):
     """get_test_instance's return value looks like an instance_ref"""
     instance_ref = test_utils.get_test_instance()
     ctxt = test_utils.get_test_admin_context()
     db.instance_get(ctxt, instance_ref['id'])