Beispiel #1
0
def prepare(model_name):
    """Run all steps to prepare the environment before a functional test run.

    :param model: Name of model to add
    :type bundle: str
    """
    zaza.controller.add_model(model_name,
                              config=deployment_env.get_model_settings(),
                              region=deployment_env.get_cloud_region())
    zaza.model.set_model_constraints(
        model_name=model_name,
        constraints=deployment_env.get_model_constraints())
Beispiel #2
0
def prepare(model_name, test_directory=None):
    """Run all steps to prepare the environment before a functional test run.

    :param model: Name of model to add
    :type bundle: str
    :param test_directory: Set the directory containing tests.yaml and bundles.
    :type test_directory: str
    """
    utils.set_base_test_dir(test_dir=test_directory)
    zaza.controller.add_model(model_name,
                              config=deployment_env.get_model_settings(),
                              region=deployment_env.get_cloud_region())
    zaza.model.set_model_constraints(
        model_name=model_name,
        constraints=deployment_env.get_model_constraints())
Beispiel #3
0
 def test_get_cloud_region_default(self):
     self.patch_object(deployment_env,
                       'get_setup_file_contents',
                       return_value={})
     self.assertEqual(deployment_env.get_cloud_region(), None)
Beispiel #4
0
 def test_get_cloud_region(self):
     self.patch_object(deployment_env,
                       'get_setup_file_contents',
                       return_value={'region': 'test'})
     self.assertEqual(deployment_env.get_cloud_region(), 'test')