示例#1
0
 def test_to_string(self):
     stack = mock.MagicMock()
     self.assertIn("Designate Zone",
                   designate.Zones(self.creds_manager).to_str(stack))
示例#2
0
 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'])
示例#3
0
 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()
示例#4
0
 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()
示例#5
0
 def test_disable(self):
     zone = mock.MagicMock()
     with self.assertLogs(level='WARNING'):
         designate.Zones(self.creds_manager).disable(zone)