Beispiel #1
0
 def test_template(self):
     i = Image(self.xml, self.client)
     i.convert_types()
     assert isinstance(i.template, Template)
Beispiel #2
0
 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)
Beispiel #3
0
 def test_repr(self):
     h = Image(self.xml, self.client)
     assert h.__repr__() == '<oca.Image("MATLAB install CD")>'
Beispiel #4
0
 def test_unpublish(self):
     self.client.call = Mock(return_value='')
     h = Image(self.xml, self.client)
     assert h.unpublish() is None
Beispiel #5
0
 def test_rmattr(self):
     self.client.call = Mock(return_value='')
     h = Image(self.xml, self.client)
     assert h.rmattr('name') is None
Beispiel #6
0
 def test_update(self):
     self.client.call = Mock(return_value='')
     h = Image(self.xml, self.client)
     assert h.update('name', 'New name') is None
Beispiel #7
0
 def test_disable(self):
     self.client.call = Mock(return_value='')
     h = Image(self.xml, self.client)
     assert h.disable() is None
Beispiel #8
0
 def test_allocate(self):
     self.client.call = Mock(return_value=2)
     assert Image.allocate(self.client, IMAGE_TEMPLATE) == 2