Esempio n. 1
0
    def test_call_delete(self, mock_notify):
        self.zone = objects.Zone(name='example.org.', action='DELETE')
        self.actor = zone.ZoneActionOnTarget(
            self.executor,
            self.context,
            self.zone,
            self.target,
        )

        self.assertTrue(self.actor())

        mock_notify.assert_not_called()
Esempio n. 2
0
    def test_call_exception_raised(self, mock_notify):
        self.backend.create_zone.side_effect = exceptions.BadRequest()
        self.zone = objects.Zone(name='example.org.', action='CREATE')
        self.actor = zone.ZoneActionOnTarget(
            self.executor,
            self.context,
            self.zone,
            self.target,
        )

        self.assertFalse(self.actor())

        mock_notify.assert_not_called()
Esempio n. 3
0
    def test_call_update(self, mock_notify):
        self.zone = objects.Zone(name='example.org.', action='UPDATE')
        self.actor = zone.ZoneActionOnTarget(
            self.executor,
            self.context,
            self.zone,
            self.target,
        )

        self.assertTrue(self.actor())

        mock_notify.assert_called_once_with(self.zone.name,
                                            '127.0.0.1',
                                            port=53)