langflow/src/backend/tests/unit
Edwin Jose 46a9789028
fix(ollama): resolve model list loading issue and add Pytest for component testing (#3575)
* Commit to solve Model not loading issue

The issue was that the url of the models: api/tags was not parsed correctly.
It was having a // hence used urlencode to parse it properly.

Th e correct apporach works only if the base_url is correct,i.e a valid ollama URL:
for DS LF this must be a public ollama Server URL.

* updated the component Ollama Component

changed the get model to take in base url and the function will make the expected url for the model names. This makes the function better, than providing the model url as paramter.

Added Pytest, 7 tests, 1 test excluded for future implememtstion: test_build_model_failure

Make lint and Make format had touched multiple files

* removed unwanted print statements

removed unwanted print statements.

make format, formatted a lot of .tsx files also

* removed skipped tests

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-27 19:21:06 -04:00
..
api feat: centralize global variable management (#3284) 2024-08-13 13:32:57 +00:00
base/tools feat: add ComponentTool to support converting Component to Tool (#3412) 2024-08-19 10:05:59 -07:00
components fix(ollama): resolve model list loading issue and add Pytest for component testing (#3575) 2024-08-27 19:21:06 -04:00
custom refactor: improve attribute compatibility and error messages (#3367) 2024-08-21 12:34:15 +00:00
exceptions feat: Add suggestion message to API exception response (#3149) 2024-08-07 15:26:24 +00:00
graph test: Add client fixture override for runnable vertices manager unit test. (#3430) 2024-08-20 04:00:38 -07:00
initial_setup/starter_projects feat: get result from output if possible (#3338) 2024-08-15 16:44:06 +00:00
inputs fix: update type to silence warning and memory chatbot json (#3265) 2024-08-09 16:01:25 +00:00
io feat: add function to create input schema from component inputs (#3411) 2024-08-19 09:36:05 -07:00
schema fix: update message reload and update langchain-core (#3054) 2024-07-30 13:54:51 +00:00
services/variable feat: add functions to detect cycles in Graph (#3327) 2024-08-14 16:14:56 +00:00
utils bugfix: parse password on db connection string when it has @ on It (#3173) 2024-08-05 09:15:33 -03:00
__init__.py refactor: move tests folder structure and update pytest commands (#2785) 2024-07-18 15:19:43 +00:00
test_api_key.py refactor: move tests folder structure and update pytest commands (#2785) 2024-07-18 15:19:43 +00:00
test_chat_endpoint.py feat: ui build in one single http request (#3020) 2024-08-02 06:53:34 -07:00
test_cli.py refactor: move tests folder structure and update pytest commands (#2785) 2024-07-18 15:19:43 +00:00
test_custom_component.py feat: import Graph without position information (#3203) 2024-08-07 07:04:48 -07:00
test_custom_component_with_client.py feat: start using dev mode flag and add exception filter in logger (#3260) 2024-08-09 13:59:49 +00:00
test_data_class.py refactor: add fixtures for client in test files to speed them up (#3490) 2024-08-22 12:08:47 -07:00
test_data_components.py feat: add starter project graphs (#3369) 2024-08-16 12:47:19 -07:00
test_database.py fix: change ValueError into Warning to allow disconnected flows to run and other small fixes (#3249) 2024-08-08 20:21:21 +00:00
test_experimental_components.py refactor: add fixtures for client in test files to speed them up (#3490) 2024-08-22 12:08:47 -07:00
test_files.py fix: improve file name generation in upload_file function to prevent files with the same name (#3550) 2024-08-26 18:35:19 +00:00
test_frontend_nodes.py refactor: add fixtures for client in test files to speed them up (#3490) 2024-08-22 12:08:47 -07:00
test_helper_components.py refactor: add fixtures for client in test files to speed them up (#3490) 2024-08-22 12:08:47 -07:00
test_initial_setup.py fix: starter projects refresh don't add new fields (#3110) 2024-07-31 13:43:00 +00:00
test_kubernetes_secrets.py refactor: move tests folder structure and update pytest commands (#2785) 2024-07-18 15:19:43 +00:00
test_loading.py refactor: add fixtures for client in test files to speed them up (#3490) 2024-08-22 12:08:47 -07:00
test_logger.py refactor: add fixtures for client in test files to speed them up (#3490) 2024-08-22 12:08:47 -07:00
test_login.py refactor: move tests folder structure and update pytest commands (#2785) 2024-07-18 15:19:43 +00:00
test_messages.py refactor: move tests folder structure and update pytest commands (#2785) 2024-07-18 15:19:43 +00:00
test_process.py refactor: move tests folder structure and update pytest commands (#2785) 2024-07-18 15:19:43 +00:00
test_setup_superuser.py refactor: move tests folder structure and update pytest commands (#2785) 2024-07-18 15:19:43 +00:00
test_telemetry.py refactor: move tests folder structure and update pytest commands (#2785) 2024-07-18 15:19:43 +00:00
test_template.py refactor: add fixtures for client in test files to speed them up (#3490) 2024-08-22 12:08:47 -07:00
test_validate_code.py refactor: add fixtures for client in test files to speed them up (#3490) 2024-08-22 12:08:47 -07:00
test_version.py feat: expose main_version on /version endpoint (#2944) 2024-07-26 13:56:18 +02:00