def test_template(self): i = Image(self.xml, self.client) i.convert_types() assert isinstance(i.template, Template)
def test_set_nonpersistent(self): self.client.call = Mock(return_value='') h = Image(self.xml, self.client) h.set_nonpersistent() self.client.call.assert_called_once_with('image.persistent', '1', False)
def test_repr(self): h = Image(self.xml, self.client) assert h.__repr__() == '<oca.Image("MATLAB install CD")>'
def test_unpublish(self): self.client.call = Mock(return_value='') h = Image(self.xml, self.client) assert h.unpublish() is None
def test_rmattr(self): self.client.call = Mock(return_value='') h = Image(self.xml, self.client) assert h.rmattr('name') is None
def test_update(self): self.client.call = Mock(return_value='') h = Image(self.xml, self.client) assert h.update('name', 'New name') is None
def test_disable(self): self.client.call = Mock(return_value='') h = Image(self.xml, self.client) assert h.disable() is None
def test_allocate(self): self.client.call = Mock(return_value=2) assert Image.allocate(self.client, IMAGE_TEMPLATE) == 2