Skip to content

Commit

Permalink
python test change
Browse files Browse the repository at this point in the history
  • Loading branch information
bubriks committed Dec 19, 2024
1 parent f2bbc87 commit 836506a
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion python/tests/test_storage_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 836506a

Please sign in to comment.