def setUp(self): super(TestCreateSubnetPool, self).setUp() self.network.create_subnet_pool = mock.Mock( return_value=self._subnet_pool) # Get the command object to test self.cmd = subnet_pool.CreateSubnetPool(self.app, self.namespace) self.network.find_address_scope = mock.Mock( return_value=self._address_scope) # Set identity client. And get a shortcut to Identity client. identity_client = identity_fakes_v3.FakeIdentityv3Client( endpoint=fakes.AUTH_URL, token=fakes.AUTH_TOKEN, ) self.app.client_manager.identity = identity_client self.identity = self.app.client_manager.identity # Get a shortcut to the ProjectManager Mock self.projects_mock = self.identity.projects self.projects_mock.get.return_value = fakes.FakeResource( None, copy.deepcopy(identity_fakes_v3.PROJECT), loaded=True, ) # Get a shortcut to the DomainManager Mock self.domains_mock = self.identity.domains self.domains_mock.get.return_value = fakes.FakeResource( None, copy.deepcopy(identity_fakes_v3.DOMAIN), loaded=True, )
def setUp(self): super(TestCreateSubnetPool, self).setUp() self.network.create_subnet_pool = mock.Mock( return_value=self._subnet_pool) # Get the command object to test self.cmd = subnet_pool.CreateSubnetPool(self.app, self.namespace)
def setUp(self): super(TestCreateSubnetPool, self).setUp() self.network.create_subnet_pool = mock.Mock( return_value=self._subnet_pool) # Get the command object to test self.cmd = subnet_pool.CreateSubnetPool(self.app, self.namespace) self.network.find_address_scope = mock.Mock( return_value=self._address_scope) self.projects_mock.get.return_value = self.project self.domains_mock.get.return_value = self.domain