def test_get_corresponding_pack_content_object(self, tmp_path): env = Environment(tmp_path) parameters = [ { 'custom_content_obj': env.INTEGRATION_CUSTOM_CONTENT_OBJECT, 'pack_content_obj': env.INTEGRATION_PACK_OBJECT }, { 'custom_content_obj': env.SCRIPT_CUSTOM_CONTENT_OBJECT, 'pack_content_obj': env.SCRIPT_PACK_OBJECT }, { 'custom_content_obj': env.PLAYBOOK_CUSTOM_CONTENT_OBJECT, 'pack_content_obj': env.PLAYBOOK_PACK_OBJECT }, { 'custom_content_obj': env.LAYOUT_CUSTOM_CONTENT_OBJECT, 'pack_content_obj': env.LAYOUT_PACK_OBJECT }, { 'custom_content_obj': env.FAKE_CUSTOM_CONTENT_OBJECT, 'pack_content_obj': {} }, ] with patch.object(Downloader, "__init__", lambda a, b, c: None): downloader = Downloader('', '') downloader.pack_content = env.PACK_CONTENT for param in parameters: corr_obj = downloader.get_corresponding_pack_content_object( param['custom_content_obj']) assert ordered(corr_obj) == ordered(param['pack_content_obj'])
def test_get_corresponding_pack_content_object(self, custom_content_object, pack_content_object): assert EnvironmentGuardian.verify_environment() with patch.object(Downloader, "__init__", lambda a, b, c: None): downloader = Downloader('', '') downloader.pack_content = PACK_CONTENT corr_obj = downloader.get_corresponding_pack_content_object(custom_content_object) assert ordered(corr_obj) == ordered(pack_content_object)