def test_getImage_callable(self): def image_callable(images): return images[0] bs = openstack.OpenStackLatentWorker('bot', 'pass', flavor=1, image=image_callable, **self.os_auth) os_client = novaclient.Client('1.1', 'user', 'pass', 'tenant', 'auth') os_client.images.images = ['uuid1', 'uuid2', 'uuid2'] self.assertEqual('uuid1', bs._getImage(os_client, image_callable))
def test_getImage_callable(self): def image_callable(images): return images[0] bs = openstack.OpenStackLatentBuildSlave('bot', 'pass', flavor=1, image=image_callable, os_username='******', os_password='******', os_tenant_name='tenant', os_auth_url='auth') os_client = novaclient.Client('user', 'pass', 'tenant', 'auth') os_client.images.images = ['uuid1', 'uuid2', 'uuid2'] self.assertEqual('uuid1', bs._getImage(os_client))