parent
f7fc1f09f0
commit
b7440570b0
|
|
@ -66,7 +66,7 @@ class TestDockerfileHelper(unittest.TestCase):
|
||||||
|
|
||||||
# check
|
# check
|
||||||
docker_helper = DockerfileHelper(arc_dockerfile_name='', gcs_path='')
|
docker_helper = DockerfileHelper(arc_dockerfile_name='', gcs_path='')
|
||||||
self.assertTrue(docker_helper._wrap_files_in_tarball(temp_tarball, {'dockerfile':temp_file_one, 'main.py':temp_file_two}))
|
docker_helper._wrap_files_in_tarball(temp_tarball, {'dockerfile':temp_file_one, 'main.py':temp_file_two})
|
||||||
self.assertTrue(os.path.exists(temp_tarball))
|
self.assertTrue(os.path.exists(temp_tarball))
|
||||||
temp_tarball_handler = tarfile.open(temp_tarball)
|
temp_tarball_handler = tarfile.open(temp_tarball)
|
||||||
temp_files = temp_tarball_handler.getmembers()
|
temp_files = temp_tarball_handler.getmembers()
|
||||||
|
|
|
||||||
|
|
@ -12,16 +12,12 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import os
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
|
||||||
import tempfile
|
import tempfile
|
||||||
import unittest
|
import unittest
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import kfp.components as comp
|
import kfp.components as comp
|
||||||
from kfp.components._yaml_utils import load_yaml
|
|
||||||
|
|
||||||
|
|
||||||
def add_two_numbers(a: float, b: float) -> float:
|
def add_two_numbers(a: float, b: float) -> float:
|
||||||
'''Returns sum of two arguments'''
|
'''Returns sum of two arguments'''
|
||||||
|
|
@ -103,7 +99,7 @@ class PythonOpTestCase(unittest.TestCase):
|
||||||
return a + b
|
return a + b
|
||||||
|
|
||||||
func = add_two_numbers_indented
|
func = add_two_numbers_indented
|
||||||
op = comp.func_to_container_op(func,output_component_file='add_two_numbers_indented.component.yaml')
|
op = comp.func_to_container_op(func)
|
||||||
|
|
||||||
self.helper_test_2_in_1_out_component_using_local_call(func, op)
|
self.helper_test_2_in_1_out_component_using_local_call(func, op)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue