Skip to content

Commit

Permalink
Addded two tests for output_component_file
Browse files Browse the repository at this point in the history
  • Loading branch information
Ark-kun committed Sep 6, 2019
1 parent 57f0445 commit 55adcc4
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions sdk/python/tests/components/test_python_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,24 @@ def test_func_to_container_op_local_call(self):

self.helper_test_2_in_1_out_component_using_local_call(func, op)

def test_func_to_container_op_output_component_file(self):
func = add_two_numbers
with tempfile.TemporaryDirectory() as temp_dir_name:
component_path = str(Path(temp_dir_name) / 'component.yaml')
comp.func_to_container_op(func, output_component_file=component_path)
op = comp.load_component_from_file(component_path)

self.helper_test_2_in_1_out_component_using_local_call(func, op)

def test_func_to_component_file(self):
func = add_two_numbers
with tempfile.TemporaryDirectory() as temp_dir_name:
component_path = str(Path(temp_dir_name) / 'component.yaml')
comp._python_op.func_to_component_file(func, output_component_file=component_path)
op = comp.load_component_from_file(component_path)

self.helper_test_2_in_1_out_component_using_local_call(func, op)

def test_indented_func_to_container_op_local_call(self):
def add_two_numbers_indented(a: float, b: float) -> float:
'''Returns sum of two arguments'''
Expand Down

0 comments on commit 55adcc4

Please sign in to comment.