mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-24 08:23:43 +08:00
🔥 refactor(test_custom_component.py): remove unused imports and test_list_flows_no_flows test case
🔥 refactor(test_custom_component.py): remove test_list_flows_no_flows test case as it is no longer needed
This commit is contained in:
@ -3,7 +3,6 @@ import pytest
|
||||
import types
|
||||
from uuid import uuid4
|
||||
|
||||
from unittest.mock import patch, MagicMock
|
||||
|
||||
from fastapi import HTTPException
|
||||
from langflow.database.models.flow import Flow, FlowCreate
|
||||
@ -466,20 +465,6 @@ def test_custom_component_build_not_implemented():
|
||||
custom_component.build()
|
||||
|
||||
|
||||
def test_list_flows_no_flows():
|
||||
session_getter_module = "langflow.database.base.session_getter"
|
||||
|
||||
with patch(session_getter_module) as mock_session_getter:
|
||||
mock_session = MagicMock()
|
||||
mock_session.query.return_value.all.return_value = []
|
||||
mock_session_getter.return_value.__enter__.return_value = mock_session
|
||||
|
||||
component = CustomComponent()
|
||||
result = component.list_flows()
|
||||
|
||||
assert len(result) == 0
|
||||
|
||||
|
||||
def test_build_config_no_code():
|
||||
component = CustomComponent(code=None)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user