Beispiel #1
0
    def test_get_client(self):
        # Set up some ksa conf options
        region = 'MyRegion'
        endpoint = 'http://example.com:1234'
        self.flags(group='cyborg',
                   region_name=region,
                   endpoint_override=endpoint)
        ctxt = context.get_admin_context()
        client = cyborg.get_client(ctxt)

        # Dig into the ksa adapter a bit to ensure the conf options got through
        # We don't bother with a thorough test of get_ksa_adapter - that's done
        # elsewhere - this is just sanity-checking that we spelled things right
        # in the conf setup.
        self.assertEqual('accelerator', client._client.service_type)
        self.assertEqual(region, client._client.region_name)
        self.assertEqual(endpoint, client._client.endpoint_override)
Beispiel #2
0
 def setUp(self):
     super(CyborgTestCase, self).setUp()
     self.context = context.get_admin_context()
     self.client = cyborg.get_client(self.context)