From 88df88a19674ccc0017836941b8ee32eaadf19fb Mon Sep 17 00:00:00 2001 From: Stuart Mackie Date: Thu, 23 Mar 2017 06:19:54 -0700 Subject: Deleted charms with wrong license. Will source them differently in future. Change-Id: I0fc99ea03c6b6ca4701e63793cb2be60e56c7588 Signed-off-by: Stuart Mackie --- .../ceilometer-agent/unit_tests/test_actions.py | 78 ---------------------- 1 file changed, 78 deletions(-) delete mode 100644 charms/trusty/ceilometer-agent/unit_tests/test_actions.py (limited to 'charms/trusty/ceilometer-agent/unit_tests/test_actions.py') diff --git a/charms/trusty/ceilometer-agent/unit_tests/test_actions.py b/charms/trusty/ceilometer-agent/unit_tests/test_actions.py deleted file mode 100644 index 6f37c83..0000000 --- a/charms/trusty/ceilometer-agent/unit_tests/test_actions.py +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright 2016 Canonical Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import mock -from mock import patch - -from test_utils import CharmTestCase - -with patch('ceilometer_utils.register_configs') as configs: - configs.return_value = 'test-config' - import actions - - -class PauseTestCase(CharmTestCase): - - def setUp(self): - super(PauseTestCase, self).setUp( - actions, ["pause_unit_helper"]) - - def test_pauses_services(self): - actions.pause([]) - self.pause_unit_helper.assert_called_once_with('test-config') - - -class ResumeTestCase(CharmTestCase): - - def setUp(self): - super(ResumeTestCase, self).setUp( - actions, ["resume_unit_helper"]) - - def test_pauses_services(self): - actions.resume([]) - self.resume_unit_helper.assert_called_once_with('test-config') - - -class MainTestCase(CharmTestCase): - - def setUp(self): - super(MainTestCase, self).setUp(actions, ["action_fail"]) - - def test_invokes_action(self): - dummy_calls = [] - - def dummy_action(args): - dummy_calls.append(True) - - with mock.patch.dict(actions.ACTIONS, {"foo": dummy_action}): - actions.main(["foo"]) - self.assertEqual(dummy_calls, [True]) - - def test_unknown_action(self): - """Unknown actions aren't a traceback.""" - exit_string = actions.main(["foo"]) - self.assertEqual("Action foo undefined", exit_string) - - def test_failing_action(self): - """Actions which traceback trigger action_fail() calls.""" - dummy_calls = [] - - self.action_fail.side_effect = dummy_calls.append - - def dummy_action(args): - raise ValueError("uh oh") - - with mock.patch.dict(actions.ACTIONS, {"foo": dummy_action}): - actions.main(["foo"]) - self.assertEqual(dummy_calls, ["uh oh"]) -- cgit 1.2.3-korg