示例#1
0
 def test_to_string(self):
     stack = mock.MagicMock()
     self.assertIn("Heat Stack",
                   heat.Stacks(self.creds_manager).to_str(stack))
示例#2
0
 def test_disable(self):
     stack = mock.MagicMock()
     with self.assertLogs(level='WARNING'):
         heat.Stacks(self.creds_manager).disable(stack)
示例#3
0
 def test_list_with_service(self):
     self.cloud.has_service.return_value = True
     self.assertIs(self.cloud.list_stacks.return_value,
                   heat.Stacks(self.creds_manager).list())
     self.cloud.list_stacks.assert_called_once_with()
示例#4
0
 def test_delete(self):
     stack = mock.MagicMock()
     self.assertIsNone(heat.Stacks(self.creds_manager).delete(stack))
     self.cloud.delete_stack.assert_called_once_with(stack['id'], wait=True)
示例#5
0
 def test_list_without_service(self):
     self.cloud.has_service.return_value = False
     self.assertEqual(heat.Stacks(self.creds_manager).list(), [])
     self.cloud.list_stacks.assert_not_called()