def test_create_agent_package(self): cli_options = { '--config': CONFIG_FILE, '--force': True, '--dryrun': False, '--no-validation': False, '--verbose': True } required_modules = [ 'cloudify-plugins-common', 'cloudify-rest-client', 'cloudify-fabric-plugin', 'cloudify-agent', 'pyyaml', 'xmltodict' ] excluded_modules = [ 'cloudify-diamond-plugin', 'cloudify-script-plugin' ] config = ap._import_config(CONFIG_FILE) cli._run(cli_options) if os.path.isdir(TEST_VENV): shutil.rmtree(TEST_VENV) os.makedirs(TEST_VENV) utils.run('tar -xzvf {0} -C {1} --strip-components=1'.format( config['output_tar'], BASE_DIR)) os.remove(config['output_tar']) self.assertTrue(os.path.isdir(TEST_VENV)) pip_freeze_output = utils.get_installed(TEST_VENV).lower() for required_module in required_modules: self.assertIn(required_module, pip_freeze_output) for excluded_module in excluded_modules: self.assertNotIn(excluded_module, pip_freeze_output) shutil.rmtree(TEST_VENV)
def test_create_agent_package(self): cli_options = { '--config': CONFIG_FILE, '--force': True, '--dryrun': False, '--no-validation': False, '--verbose': True } required_modules = [ 'cloudify-plugins-common', 'cloudify-rest-client', 'cloudify-fabric-plugin', 'cloudify-agent', 'pyyaml', 'xmltodict' ] excluded_modules = [ 'cloudify-diamond-plugin', 'cloudify-script-plugin' ] config = ap._import_config(CONFIG_FILE) cli._run(cli_options) if os.path.isdir(TEST_VENV): shutil.rmtree(TEST_VENV) os.makedirs(TEST_VENV) utils.run('tar -xzvf {0} -C {1} --strip-components=1'.format( config['output_tar'], BASE_DIR)) os.remove(config['output_tar']) self.assertTrue(os.path.isdir(TEST_VENV)) pip_freeze_output = utils.get_installed( TEST_VENV).lower() for required_module in required_modules: self.assertIn(required_module, pip_freeze_output) for excluded_module in excluded_modules: self.assertNotIn(excluded_module, pip_freeze_output) shutil.rmtree(TEST_VENV)
def test_install_module(self): utils.install_module(TEST_MODULE, TEST_VENV) pip_freeze_output = utils.get_installed(TEST_VENV).lower() self.assertIn(TEST_MODULE, pip_freeze_output)