🔥 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:
Gabriel Luiz Freitas Almeida 2023-07-27 14:35:49 -03:00
commit fb407cf9d1

View file

@ -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)