def test_to_string(self): stack = mock.MagicMock() self.assertIn("Designate Zone", designate.Zones(self.creds_manager).to_str(stack))
def test_delete(self): zone = mock.MagicMock() self.assertIsNone(designate.Zones(self.creds_manager).delete(zone)) self.cloud.delete_zone.assert_called_once_with(zone['id'])
def test_list_without_service(self): self.cloud.has_service.return_value = False self.assertEqual(designate.Zones(self.creds_manager).list(), []) self.cloud.list_zones.assert_not_called()
def test_list_with_service(self): self.cloud.has_service.return_value = True self.assertIs(self.cloud.list_zones.return_value, designate.Zones(self.creds_manager).list()) self.cloud.list_zones.assert_called_once_with()
def test_disable(self): zone = mock.MagicMock() with self.assertLogs(level='WARNING'): designate.Zones(self.creds_manager).disable(zone)