Files
zaza-openstack-tests/unit_tests/test_zaza_charm_lifecycle_destroy.py
T
Nicolas Pochet 193e2657ff Add copyright header everywhere.
Also make flake8 happy in setup.py by adding docstrings.
2018-08-09 11:55:13 +02:00

29 lines
1.0 KiB
Python

# Copyright 2018 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 zaza.charm_lifecycle.destroy as lc_destroy
import unit_tests.utils as ut_utils
class TestCharmLifecycleDestroy(ut_utils.BaseTestCase):
def test_destroy(self):
self.patch_object(lc_destroy.zaza.controller, 'destroy_model')
lc_destroy.destroy('doomed')
self.destroy_model.assert_called_once_with('doomed')
def test_parser(self):
args = lc_destroy.parse_args(['-m', 'doomed'])
self.assertEqual(args.model_name, 'doomed')