Refactor code for improved readability and maintainability
This commit is contained in:
parent
9802322ae9
commit
ef4b9f96e5
1 changed files with 7 additions and 3 deletions
|
|
@ -24,7 +24,9 @@ def test_document_to_record_component():
|
|||
|
||||
# Act
|
||||
# Replace with your actual test data
|
||||
document = Document(page_content="key: value", metadata={"url": "https://example.com"})
|
||||
document = Document(
|
||||
page_content="key: value", metadata={"url": "https://example.com"}
|
||||
)
|
||||
result = document_to_record_component.build(document)
|
||||
|
||||
# Assert
|
||||
|
|
@ -37,12 +39,14 @@ def test_uuid_generator_component():
|
|||
uuid_generator_component = helpers.UUIDGeneratorComponent()
|
||||
uuid_generator_component.code = open(helpers.IDGenerator.__file__, "r").read()
|
||||
|
||||
frontend_node = build_custom_component_template(uuid_generator_component)
|
||||
frontend_node, _ = build_custom_component_template(uuid_generator_component)
|
||||
|
||||
# Act
|
||||
build_config = frontend_node.get("template")
|
||||
field_name = "unique_id"
|
||||
build_config = uuid_generator_component.update_build_config(build_config, None, field_name)
|
||||
build_config = uuid_generator_component.update_build_config(
|
||||
build_config, None, field_name
|
||||
)
|
||||
unique_id = build_config["unique_id"]["value"]
|
||||
result = uuid_generator_component.build(unique_id)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue