0aa7c61719
Recently functions were added to zaza.model for adding and removing models. These duplicated existing functions in zaza.controller. Given these functions act against the controller, zaza.controller feels like the correct location. In addition the implementations in zaza.controller correctly handle disconnects which the new ones did not. This PR removes the duplicates and points any existing references from zaza.model to zaza.controller. Finally, docstrings were added and documentation links.
25 lines
878 B
Python
25 lines
878 B
Python
import zaza.charm_lifecycle.prepare as lc_prepare
|
|
import unit_tests.utils as ut_utils
|
|
|
|
|
|
class TestCharmLifecyclePrepare(ut_utils.BaseTestCase):
|
|
|
|
def test_prepare(self):
|
|
self.patch_object(lc_prepare.zaza.controller, 'add_model')
|
|
lc_prepare.prepare('newmodel')
|
|
self.add_model.assert_called_once_with(
|
|
'newmodel',
|
|
config={
|
|
'agent-stream': 'proposed',
|
|
'default-series': 'xenial',
|
|
'image-stream': 'daily',
|
|
'test-mode': 'true',
|
|
'transmit-vendor-metrics': 'false',
|
|
'enable-os-upgrade': 'false',
|
|
'automatically-retry-hooks': 'false',
|
|
'use-default-secgroup': 'true'})
|
|
|
|
def test_parser(self):
|
|
args = lc_prepare.parse_args(['-m', 'newmodel'])
|
|
self.assertEqual(args.model_name, 'newmodel')
|