Esempio n. 1
0
 def test_get_main_file_details(self, tmp_path):
     env = Environment(tmp_path)
     parameters = [{
         'entity': INTEGRATIONS_DIR,
         'path': env.INTEGRATION_INSTANCE_PATH,
         'main_id': 'Test Integration',
         'main_name': 'Test Integration'
     }, {
         'entity': LAYOUTS_DIR,
         'path': env.LAYOUT_INSTANCE_PATH,
         'main_id': 'Hello World Alert',
         'main_name': 'Hello World Alert'
     }, {
         'entity': LAYOUTS_DIR,
         'path': 'demisto_sdk/commands/download/tests/downloader_test.py',
         'main_id': '',
         'main_name': ''
     }]
     downloader = Downloader(output='', input='', regex='')
     for param in parameters:
         op_id, op_name = downloader.get_main_file_details(
             param['entity'], os.path.abspath(param['path']))
         assert op_id == param['main_id']
         assert op_name == param['main_name']
 def test_get_main_file_details(self, entity, path, main_id, main_name):
     assert EnvironmentGuardian.verify_environment()
     downloader = Downloader(output='', input='')
     op_id, op_name = downloader.get_main_file_details(entity, os.path.abspath(path))
     assert op_id == main_id
     assert op_name == main_name