MCPcopy Create free account
hub / github.com/apache/burr / test_get_component_source

Function test_get_component_source

tests/integrations/test_burr_haystack.py:121–141  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

119
120
121def test_get_component_source():
122 haction = HaystackAction(
123 component=MockComponent(required_init="init"), name="mock", reads=[], writes=[]
124 )
125
126 expected_source = """\
127@component
128class MockComponent:
129 def __init__(self, required_init: str, optional_init: str = "default"):
130 self.required_init = required_init
131 self.optional_init = optional_init
132
133 @component.output_types(output_1=str, output_2=str)
134 def run(self, required_input: str, optional_input: str = "default") -> dict:
135 return {
136 "output_1": required_input,
137 "output_2": optional_input,
138 }
139"""
140
141 assert haction.get_source() == expected_source
142
143
144def test_run_with_external_inputs():

Callers

nothing calls this directly

Calls 3

get_sourceMethod · 0.95
HaystackActionClass · 0.90
MockComponentClass · 0.85

Tested by

no test coverage detected