Ejemplo n.º 1
0
 def test_invalid_data(self):
     """
     Test creating a zrobot with invalid data
     """
     with pytest.raises(ValueError, message='template should fail to instantiate if configRepo is sepcified without sshkey'):
         zrobot = Zrobot(name='zrobot', data={'configRepo': 'https://example.com/account/config'})
         zrobot.validate()
Ejemplo n.º 2
0
 def test_valid_data(self):
     """
     Test creating a zrobot service with valid data
     """
     zrobot = Zrobot('zrobot', data=self.valid_data)
     zrobot.api.services.get = MagicMock()
     zrobot.validate()
     assert zrobot.data == self.valid_data
Ejemplo n.º 3
0
 def test_invalid_data(self):
     """
     Test creating a zrobot with invalid data
     """
     with pytest.raises(
             ValueError,
             message=
             'template should fail to instantiate if data dict is missing the node'
     ):
         zrobot = Zrobot(name='zrobot', data={})
         zrobot.validate()
Ejemplo n.º 4
0
 def test_install_zrobot_node_not_found(self):
     """
     Test installing a zrobot with no service found for the node
     """
     with pytest.raises(
             scol.ServiceNotFoundError,
             message=
             'install action should raise an error if node service is not found'
     ):
         zrobot = Zrobot('zrobot', data=self.valid_data)
         zrobot.api.services.get = MagicMock(
             side_effect=scol.ServiceNotFoundError())
         zrobot.validate()