langflow/src/backend/tests/unit
Cristhian Zanforlin Lousa d98d37778d
feat: enhance YouTubeTranscripts component with Data output support (#6113)
* 📝 (youtube_transcripts.py): update description of YouTubeTranscriptsComponent to be more concise and accurate
 (youtube_transcripts.py): add new output option 'data_output' to provide transcript along with the source video URL
🔧 (youtube_transcripts.py): add method 'get_data_output' to handle the new 'data_output' output option and return a Data object with transcript, video URL, and error message

* [autofix.ci] apply automated fixes

* 📝 (youtube_transcripts.py): improve documentation for get_data_output method to provide a clear description of the returned data object and its contents
🐛 (youtube_transcripts.py): handle specific exceptions from the youtube_transcript_api library to provide more informative error messages and improve error handling in the get_data_output method

* [autofix.ci] apply automated fixes

* 🐛 (youtube_transcripts.py): handle case where no transcripts are found by updating the error message and returning a default data object
🔧 (youtube_transcripts.py): refactor get_data_output method to use a default data object and combine all transcript parts into a single continuous text

* [autofix.ci] apply automated fixes

*  (test_youtube_transcript_component.py): Add unit tests for YouTubeTranscriptsComponent to test various functionalities such as component initialization, output generation, error handling, and setting translation languages.

* [autofix.ci] apply automated fixes

*  (test_youtube_transcript_component.py): update file_names_mapping fixture to return a non-empty list to properly test different versions of file names mapping in the YouTube transcripts component

* [autofix.ci] apply automated fixes

* 📝 (test_youtube_transcript_component.py): Add docstrings and improve variable names for better readability and maintainability
🔧 (test_youtube_transcript_component.py): Refactor error handling in test methods to use descriptive error messages and improve code readability

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-02-12 18:25:22 +00:00
..
api feat: Unified File Management API (#6100) 2025-02-06 18:35:24 +00:00
base feat: Add unit tests for run_flow_from_json with fake environment variables (#4015) 2025-01-31 18:51:34 +00:00
components feat: enhance YouTubeTranscripts component with Data output support (#6113) 2025-02-12 18:25:22 +00:00
custom feat: run flow component with tool mode option to run a flow as a tool (#5518) 2025-01-17 23:12:56 +00:00
events ref: Some ruff fixes from preview (#5420) 2024-12-28 21:25:35 +00:00
exceptions ref: Some ruff fixes from preview (#5420) 2024-12-28 21:25:35 +00:00
graph Fix: update initial graph sort for disconnected graph (#5867) 2025-01-22 20:27:23 +00:00
helpers fix: resolve data keyword conflict in template formatting (#5483) 2024-12-31 13:13:31 +00:00
initial_setup fix: Implement get_or_create_default_folder for user folder management (#6090) 2025-02-03 18:34:58 +00:00
inputs fix: pass slider input values correctly, add test (#5735) 2025-01-16 18:41:17 +00:00
io ref: Some ruff fixes from preview (#5420) 2024-12-28 21:25:35 +00:00
schema ref: Some ruff fixes from preview (#5420) 2024-12-28 21:25:35 +00:00
serialization refactor: Implement unified serialization function (#6044) 2025-02-03 15:12:03 +00:00
services feat: implement function to truncate json (#5811) 2025-01-20 21:15:07 +00:00
utils refactor: Implement unified serialization function (#6044) 2025-02-03 15:12:03 +00:00
__init__.py refactor: move tests folder structure and update pytest commands (#2785) 2024-07-18 15:19:43 +00:00
mock_language_model.py fix: add default models to Anthropic and make sure template is updated (#5839) 2025-01-21 07:25:47 -08:00
test_api_key.py ref: Add ALL ruff rules for tests (#4183) 2024-10-19 20:41:37 +00:00
test_chat_endpoint.py fix: make chat input sorting logic exclude other components (#5760) 2025-01-20 13:49:44 +00:00
test_cli.py refactor: remove unnecessary 'client' fixture and update test durations (#4283) 2024-10-27 14:16:45 +00:00
test_custom_component.py fix: Use relative paths for data files in unit tests (#6021) 2025-01-30 12:34:31 +00:00
test_custom_component_with_client.py ref: Make list_flows async (#5222) 2024-12-12 16:02:43 +00:00
test_data_class.py ref: Some ruff fixes from preview (#5420) 2024-12-28 21:25:35 +00:00
test_database.py ref: Some ruff fixes from preview (#5420) 2024-12-28 21:25:35 +00:00
test_endpoints.py fix: make chat input sorting logic exclude other components (#5760) 2025-01-20 13:49:44 +00:00
test_experimental_components.py ref: Remove autouse from pytest client fixture (#4158) 2024-10-15 22:55:10 +00:00
test_frontend_nodes.py ref: Auto-fix ruff rules in tests (#4154) 2024-10-16 15:42:36 +00:00
test_helper_components.py feat: Refactor langflow Components - Consolidate Imports, Remove Unused Components, and Update Astra Assistant Icons (#4460) 2024-11-11 19:30:05 +00:00
test_initial_setup.py feat: Centralize database connection settings and deprecate old parameters (#5960) 2025-01-29 11:44:31 +00:00
test_kubernetes_secrets.py ref: Add ALL ruff rules for tests (#4183) 2024-10-19 20:41:37 +00:00
test_loading.py ref: Make load_flow_from_json async (#5057) 2024-12-11 17:53:33 +00:00
test_logger.py ref: Auto-fix ruff rules in tests (#4154) 2024-10-16 15:42:36 +00:00
test_login.py ref: Remove unused sync session_scope, with_session and engine (#5333) 2024-12-18 20:52:06 +00:00
test_messages.py fix: make sure tests run async (#5842) 2025-01-21 08:16:33 -08:00
test_messages_endpoints.py ref: Remove unused sync session_scope, with_session and engine (#5333) 2024-12-18 20:52:06 +00:00
test_process.py ref: Remove some useless asyncio.to_thread (#5149) 2024-12-08 20:13:08 +01:00
test_schema.py feat: Add tool_mode to Output model and add it to the skip output check (#6036) 2025-01-30 21:39:20 +00:00
test_setup_superuser.py fix: Use AsyncSession for user management (#4491) 2024-11-16 01:09:33 +00:00
test_telemetry.py ref: Some ruff fixes from preview (#5420) 2024-12-28 21:25:35 +00:00
test_template.py ref: Auto-fix ruff rules in tests (#4154) 2024-10-16 15:42:36 +00:00
test_user.py ref: Make initialize_database async (#5163) 2024-12-10 07:44:34 +01:00
test_validate_code.py fix: Ensure importability of modules not included in __init__.py files (#5965) 2025-01-28 12:18:40 +00:00
test_version.py ref: Auto-fix ruff rules in tests (#4154) 2024-10-16 15:42:36 +00:00
test_webhook.py refactor: add graph utility tests and refactor sorting methods (#5538) 2025-01-09 20:15:24 +00:00