Commit graph

19 commits

Author SHA1 Message Date
Gabriel Luiz Freitas Almeida
8502898032 Refactor test_setup_superuser.py 2024-01-25 16:16:28 -03:00
Gabriel Luiz Freitas Almeida
a6a69a0f3a Fix import statements and formatting issues 2024-01-25 13:03:42 -03:00
Gabriel Luiz Freitas Almeida
5388423e0e Fix formatting issues in code 2023-12-05 18:39:20 -03:00
Gabriel Luiz Freitas Almeida
c3f9433612 Fix superuser deletion bug 2023-12-05 18:35:14 -03:00
Gabriel Luiz Freitas Almeida
c0ca8bbd04 Remove unnecessary code in test_setup_superuser.py 2023-11-27 17:15:44 -03:00
Gabriel Luiz Freitas Almeida
9d6cafd8a2 Update database model imports 2023-11-24 11:19:22 -03:00
Gabriel Luiz Freitas Almeida
d93df82607 Refactor dependencies and imports in
custom_component.py and add new deps.py file
2023-11-14 22:01:37 -03:00
Gabriel Luiz Freitas Almeida
c36e901a74 Refactor imports and reformat code in
test_setup_superuser.py
2023-11-14 22:00:46 -03:00
Gabriel Luiz Freitas Almeida
2def762831 📦 chore(getters.py): add getters for various services and session in langflow backend
🔨 refactor(test_setup_superuser.py): refactor imports and replace deprecated dependencies in test_setup_superuser.py
2023-11-14 21:57:48 -03:00
Gabriel Luiz Freitas Almeida
e4d8687a09 ruff format 2023-11-13 18:32:34 -03:00
Gabriel Luiz Freitas Almeida
c50d1344ca rename getters to deps 2023-10-18 09:18:16 -03:00
Gabriel Luiz Freitas Almeida
ed61bb5b8b 🔥 refactor(test_setup_superuser.py): remove unused import and function setup_superuser to improve code readability and maintainability 2023-10-04 17:43:56 -03:00
Gabriel Luiz Freitas Almeida
62fc19b1e6 🔧 fix(test_setup_superuser.py): comment out unused imports and test cases to improve code readability and maintainability 2023-10-04 17:42:52 -03:00
Gabriel Luiz Freitas Almeida
9751c5cb62 🔒 test(test_setup_superuser.py): add mock for verify_password function to fix test failure 2023-10-03 18:14:32 -03:00
Gabriel Luiz Freitas Almeida
200f5d647c fix more linting issues 2023-09-22 18:15:23 -03:00
Gabriel Luiz Freitas Almeida
479a808634 🔧 fix(endpoints.py): remove unused import and function call to improve code cleanliness and maintainability
🔧 fix(endpoints.py): move import statement to the top of the file for better organization and readability
🔧 fix(getters.py): change service type from DATABASE_MANAGER to DATABASE_SERVICE for consistency and clarity
🔧 fix(getters.py): change service type from CACHE_MANAGER to CACHE_SERVICE for consistency and clarity
🔧 fix(getters.py): change service type from SESSION_MANAGER to SESSION_SERVICE for consistency and clarity
🔧 fix(getters.py): change service type from TASK_MANAGER to TASK_SERVICE for consistency and clarity
🔧 fix(getters.py): remove unused function get_chat_service() to improve code cleanliness and maintainability
🔧 fix(getters.py): remove duplicate function get_settings_service() to improve code cleanliness and maintainability
🔧 fix(getters.py): remove duplicate function get_db_service() to improve code cleanliness and maintainability
🔧 fix(getters.py): remove duplicate function get_session() to improve code cleanliness and maintainability
🔧 fix(utils.py): remove unused import statement to improve code cleanliness and maintainability
🔧 fix(utils.py): remove unused function setup_superuser() to improve code cleanliness and maintainability
🔧 fix(utils.py): remove unused function teardown_superuser() to improve code cleanliness and maintainability
🔧 fix(utils.py): remove unused function teardown_services() to improve code cleanliness and maintainability
🔧 fix(utils.py): remove unused function initialize_settings_manager() to improve code cleanliness and maintainability
🔧 fix(utils.py): remove unused function initialize_session_manager() to improve code cleanliness and maintainability
🔧 fix(utils.py): remove unused function initialize_services() to improve code cleanliness and maintainability
🔧 fix(conftest.py): remove unused import statement to improve code cleanliness and maintainability
🔧 fix(conftest.py): remove unused function get_session_override() to improve code cleanliness and maintainability
🔧 fix(conftest.py): remove unused function distributed_client_fixture() to improve code cleanliness and maintainability
🔧 fix(conftest.py): remove unused function client_fixture() to improve code cleanliness and maintainability
🔧 fix(conftest.py): remove unused function test_user() to improve code cleanliness and maintainability
🔧 fix(conftest.py): remove unused function active_user

🐛 fix(test_endpoints.py): update import statements to use get_db_service instead of get_db_manager to improve code semantics
🐛 fix(test_login.py): update import statements to use get_db_service instead of get_db_manager to improve code semantics
🐛 fix(test_setup_superuser.py): update import statements to use get_db_service instead of get_db_manager to improve code semantics
🐛 fix(test_user.py): update import statements to use get_db_service instead of get_db_manager to improve code semantics
2023-09-22 18:07:55 -03:00
Gabriel Luiz Freitas Almeida
b441d42559 🐛 fix(test_setup_superuser.py): fix test_setup_superuser to correctly assert the number of calls to mock_create_super_user
 feat(test_setup_superuser.py): add support for testing the creation of superuser with different credentials
2023-09-20 18:36:12 -03:00
Gabriel Luiz Freitas Almeida
82469752f8 🔧 fix(tests/conftest.py): remove unused imports and commented out code
🔧 fix(tests/conftest.py): remove unused fixture 'client'
🔧 fix(tests/conftest.py): remove unused import of 'langflow.main.create_app'
🔧 fix(tests/conftest.py): remove unused fixture 'client_fixture'
🔧 fix(tests/conftest.py): remove unused import of 'langflow.services.database.manager.DatabaseManager'
🔧 fix(tests/conftest.py): remove unused import of 'typer.testing.CliRunner'
🔧 fix(tests/conftest.py): remove unused import of 'sqlmodel.SQLModel'
🔧 fix(tests/conftest.py): remove unused import of 'sqlmodel.Session'
🔧 fix(tests/conftest.py): remove unused import of 'sqlmodel.create_engine'
🔧 fix(tests/conftest.py): remove unused import of 'sqlmodel.pool.StaticPool'
🔧 fix(tests/conftest.py): remove unused import of 'tempfile'
🔧 fix(tests/conftest.py): remove unused import of 'Path'
🔧 fix(tests/conftest.py): remove unused import of 'contextmanager'
🔧 fix(tests/test_custom_component.py): remove unused argument 'session_getter' from test functions
🔧 fix(tests/test_custom_component.py): remove unused import of 'db'
🔧 fix(tests/test_custom_component.py): remove unused import of 'Flow'
🔧 fix(tests/test_setup_superuser.py): remove unused import of 'DEFAULT_SUPERUSER_PASSWORD'
🔧 fix(tests/test_setup_superuser.py): remove unused import of 'Mock'
🔧 fix(tests/test_setup_superuser.py): remove unused import of 'User'
🔧 fix(tests/test_setup_superuser.py): remove unused import of 'reset_mock_credentials'
🔧 fix(tests/test_setup_superuser.py): remove unused import of 'mock_create_super_user'
🔧 fix(tests/test_setup_superuser.py): remove unused import of 'setup_superuser'
🔧 fix(tests/test_setup_superuser.py): remove unused import of 'mock_user'
🔧 fix(tests/test_setup_superuser.py): remove unused import of 'mock_get_session'
🔧 fix(tests/test_setup_superuser.py): remove unused import of 'mock_get_settings_manager'
2023-09-20 14:32:14 -03:00
Gabriel Luiz Freitas Almeida
aeecd6279f 🚀 feat(test_setup_superuser.py): add tests for setup_superuser and teardown_superuser functions
🔒 test(test_setup_superuser.py): test when AUTO_LOGIN is True, setup_superuser should not call get_session and create_super_user

🔒 test(test_setup_superuser.py): test when username and password are default, setup_superuser should call get_session, query, filter, and create_super_user with correct arguments, and reset superuser credentials

🔒 test(test_setup_superuser.py): test when superuser already exists, setup_superuser should call get_session, query, and filter with correct arguments, and not call create_super_user

🔒 test(test_teardown_superuser_default_superuser): test teardown_superuser with default superuser, should call get_session, query, filter, delete, and commit with correct arguments

🔒 test(test_teardown_superuser_no_default_superuser): test teardown_superuser without default superuser, should not call get_session, query, delete, and commit
2023-09-18 17:43:31 -03:00