chore(api/tests): apply ruff reformat #7590 (#7591)

Co-authored-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
Bowen Liang
2024-08-23 23:52:25 +08:00
committed by GitHub
parent 2da63654e5
commit b035c02f78
155 changed files with 4279 additions and 5925 deletions

View File

@@ -3,4 +3,4 @@ class ParentClass:
self.name = name
def get_name(self):
return self.name
return self.name

View File

@@ -7,26 +7,26 @@ from tests.integration_tests.utils.parent_class import ParentClass
def test_loading_subclass_from_source():
current_path = os.getcwd()
module = load_single_subclass_from_source(
module_name='ChildClass',
script_path=os.path.join(current_path, 'child_class.py'),
parent_type=ParentClass)
assert module and module.__name__ == 'ChildClass'
module_name="ChildClass", script_path=os.path.join(current_path, "child_class.py"), parent_type=ParentClass
)
assert module and module.__name__ == "ChildClass"
def test_load_import_module_from_source():
current_path = os.getcwd()
module = import_module_from_source(
module_name='ChildClass',
py_file_path=os.path.join(current_path, 'child_class.py'))
assert module and module.__name__ == 'ChildClass'
module_name="ChildClass", py_file_path=os.path.join(current_path, "child_class.py")
)
assert module and module.__name__ == "ChildClass"
def test_lazy_loading_subclass_from_source():
current_path = os.getcwd()
clz = load_single_subclass_from_source(
module_name='LazyLoadChildClass',
script_path=os.path.join(current_path, 'lazy_load_class.py'),
module_name="LazyLoadChildClass",
script_path=os.path.join(current_path, "lazy_load_class.py"),
parent_type=ParentClass,
use_lazy_loader=True)
instance = clz('dify')
assert instance.get_name() == 'dify'
use_lazy_loader=True,
)
instance = clz("dify")
assert instance.get_name() == "dify"