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