def test_wrong_get_by_name(self): self.client.call = Mock(return_value=self.xml) pool = oca.VirtualMachinePool(self.client) pool.info() pool.get_by_name('wrong-vm-name')
def test_get_by_name(self): self.client.call = Mock(return_value=self.xml) pool = oca.VirtualMachinePool(self.client) pool.info() assert pool.get_by_name('vm-in').name == 'vm-in'
def test_wrong_get_by_id(self): self.client.call = Mock(return_value=self.xml) pool = oca.VirtualMachinePool(self.client) pool.info() pool.get_by_id(1010011010)
def test_vm_pool_info(self): self.client.call = Mock(return_value=self.xml) pool = oca.VirtualMachinePool(self.client) pool.info() assert len(list(pool)) == 3
def test_get_by_id(self): self.client.call = Mock(return_value=self.xml) pool = oca.VirtualMachinePool(self.client) pool.info() assert pool.get_by_id(8).id == 8