From 270c0c5f5c909fa99ce90280a9fd870aac77be5f Mon Sep 17 00:00:00 2001 From: Alexey Volkov Date: Mon, 5 Nov 2018 01:46:12 -0800 Subject: [PATCH 1/2] SDK/Tests/Components - Corrected test argument types --- sdk/python/tests/components/test_python_op.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/python/tests/components/test_python_op.py b/sdk/python/tests/components/test_python_op.py index 429a9e87aaf..10c6fa65e9e 100644 --- a/sdk/python/tests/components/test_python_op.py +++ b/sdk/python/tests/components/test_python_op.py @@ -47,8 +47,8 @@ def add_two_numbers_decorated_with_parameters(a: float, b: float) -> float: class PythonOpTestCase(unittest.TestCase): def helper_test_2_in_1_out_component_using_local_call(self, func, op): - arg1 = 3 - arg2 = 5 + arg1 = float(3) + arg2 = float(5) expected = func(arg1, arg2) if isinstance(expected, tuple): @@ -69,8 +69,8 @@ def helper_test_2_in_1_out_component_using_local_call(self, func, op): self.assertEqual(actual_str, expected_str) def helper_test_2_in_2_out_component_using_local_call(self, func, op): - arg1 = 3 - arg2 = 5 + arg1 = float(3) + arg2 = float(5) expected_tuple = func(arg1, arg2) expected1_str = str(expected_tuple[0]) From fa921babac08fd169b38ca5d7982acd317aae8bb Mon Sep 17 00:00:00 2001 From: Alexey Volkov Date: Mon, 5 Nov 2018 14:16:25 -0800 Subject: [PATCH 2/2] Using the float comparison --- sdk/python/tests/components/test_python_op.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/python/tests/components/test_python_op.py b/sdk/python/tests/components/test_python_op.py index 10c6fa65e9e..8ce2d037e2e 100644 --- a/sdk/python/tests/components/test_python_op.py +++ b/sdk/python/tests/components/test_python_op.py @@ -66,7 +66,7 @@ def helper_test_2_in_1_out_component_using_local_call(self, func, op): actual_str = Path(output_path).read_text() - self.assertEqual(actual_str, expected_str) + self.assertEqual(float(actual_str), float(expected_str)) def helper_test_2_in_2_out_component_using_local_call(self, func, op): arg1 = float(3) @@ -88,8 +88,8 @@ def helper_test_2_in_2_out_component_using_local_call(self, func, op): actual1_str = Path(output_path1).read_text() actual2_str = Path(output_path2).read_text() - self.assertEqual(actual1_str, expected1_str) - self.assertEqual(actual2_str, expected2_str) + self.assertEqual(float(actual1_str), float(expected1_str)) + self.assertEqual(float(actual2_str), float(expected2_str)) def test_func_to_container_op_local_call(self): func = add_two_numbers