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_in_existing_venv_force(self):
     cli_options = {
         '--config': CONFIG_FILE,
         '--force': True,
         '--dryrun': False,
         '--no-validation': False,
         '--verbose': True
     }
     utils.make_virtualenv(TEST_VENV)
     try:
         cli._run(cli_options)
     finally:
         shutil.rmtree(TEST_VENV)
 def test_create_agent_package_in_existing_venv_force(self):
     cli_options = {
         '--config': CONFIG_FILE,
         '--force': True,
         '--dryrun': False,
         '--no-validation': False,
         '--verbose': True
     }
     utils.make_virtualenv(TEST_VENV)
     try:
         cli._run(cli_options)
     finally:
         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)