From 836506a08a7f2d38fe1511dd42e831d4ba05f30a Mon Sep 17 00:00:00 2001 From: bubriks Date: Thu, 19 Dec 2024 14:35:11 +0200 Subject: [PATCH] python test change --- python/tests/test_storage_connector.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/python/tests/test_storage_connector.py b/python/tests/test_storage_connector.py index 5dc96a546..a1f7e77c3 100644 --- a/python/tests/test_storage_connector.py +++ b/python/tests/test_storage_connector.py @@ -113,9 +113,21 @@ def test_default_path(self, mocker): ) sc.read(data_format="csv") # assert - assert "" == mock_engine_read.call_args[0][3] + assert "s3://test-bucket" in mock_engine_read.call_args[0][3] def test_get_path(self, mocker): + mocker.patch("hsfs.engine.get_instance", return_value=spark.Engine()) + sc = storage_connector.S3Connector( + id=1, name="test_connector", featurestore_id=1, bucket="test-bucket" + ) + + # act + result = sc._get_path("some/location") + + # assert + assert "s3://test-bucket/some/location" == result + + def test_get_path_storage_connector_with_path(self, mocker): mocker.patch("hsfs.engine.get_instance", return_value=spark.Engine()) sc = storage_connector.S3Connector( id=1, name="test_connector", featurestore_id=1, bucket="test-bucket", path="abc/def"