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