Пример #1
0
 def test_valid_data(self):
     """
     Test creating service with valid data
     """
     bootstrap = ZeroosBootstrap('bootstrap', data=self.valid_data)
     bootstrap.api.services = MagicMock()
     bootstrap.validate()
     assert bootstrap.data == self.valid_data
Пример #2
0
    def test_invalid_data(self):
        """
        Test creating service with invalid data
        """
        with pytest.raises(
                RuntimeError,
                message='Template should raise error if data is invalid'):
            bootstrap = ZeroosBootstrap('bootstrap', data={})
            bootstrap.validate()

        # test that the network service doesn't exist
        with pytest.raises(
                ServiceNotFoundError,
                message=
                'Template should raise error if network service doesn\'t exist'
        ):
            bootstrap = ZeroosBootstrap('bootstrap', data=self.valid_data)
            bootstrap.validate()