Skip to content

Commit

Permalink
modified the unit test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
yogesh266 committed Jul 26, 2023
1 parent 033ce8d commit 806d500
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/unitary/with_extras/feature_store/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from ads.feature_store.service.oci_dataset import OCIDataset
from ads.feature_store.service.oci_feature_store import OCIFeatureStore
from ads.feature_store.feature_store import FeatureStore
from tests.unitary.install_required.feature_store.test_feature_store import (
from tests.unitary.with_extras.feature_store.test_feature_store import (
FEATURE_STORE_PAYLOAD,
)

Expand Down
16 changes: 11 additions & 5 deletions tests/unitary/with_extras/feature_store/test_feature_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from ads.feature_store.input_feature_detail import FeatureDetail, FeatureType
from ads.feature_store.service.oci_feature_group import OCIFeatureGroup
from ads.feature_store.service.oci_feature_store import OCIFeatureStore
from tests.unitary.install_required.feature_store.test_feature_group_job import (
from tests.unitary.with_extras.feature_store.test_feature_group_job import (
FEATURE_GROUP_JOB_PAYLOAD,
)

Expand All @@ -32,6 +32,8 @@
"entityId": "ocid1.entity.oc1.iad.xxx",
"description": "feature group description",
"primaryKeys": {"items": []},
"partitionKeys": {"items": []},
"transformationParameters": "e30=",
"featureStoreId": "ocid1.featurestore.oc1.iad.xxx",
"compartmentId": "ocid1.compartment.oc1.iad.xxx",
"inputFeatureDetails": [
Expand Down Expand Up @@ -133,6 +135,8 @@ def test_with_methods_1(self, mock_load_default_properties):
.with_entity_id(self.payload["entityId"])
.with_feature_store_id(self.payload["featureStoreId"])
.with_primary_keys([])
.with_partition_keys([])
.with_transformation_kwargs({})
.with_input_feature_details(input_feature_details)
)
assert self.prepare_dict(
Expand All @@ -154,6 +158,8 @@ def test_with_methods_2(self):
.with_entity_id(self.payload["entityId"])
.with_feature_store_id(self.payload["featureStoreId"])
.with_primary_keys([])
.with_partition_keys([])
.with_transformation_kwargs({})
.with_input_feature_details(input_feature_details)
)
assert self.prepare_dict(
Expand Down Expand Up @@ -205,8 +211,8 @@ def test_from_id(self, mock_oci_from_id, mock__update_from_oci_fs_model):

@patch.object(OCIFeatureGroup, "create")
def test_create_success(
self,
mock_oci_dsc_model_create,
self,
mock_oci_dsc_model_create,
):
"""Tests creating datascience feature_group."""
oci_dsc_model = OCIFeatureGroup(**FEATURE_GROUP_PAYLOAD)
Expand Down Expand Up @@ -275,7 +281,7 @@ def test__to_oci_fs_entity(self, mock_load_key_file, mock_config_from_file):
@patch.object(SparkSessionSingleton, "__init__", return_value=None)
@patch.object(SparkSessionSingleton, "get_spark_session")
def test_materialise(
self, spark_session, get_spark_session, mocke_update, dataframe_fixture_basic
self, spark_session, get_spark_session, mocke_update, dataframe_fixture_basic
):
with patch.object(FeatureGroupJob, "create") as mock_feature_group_job:
with patch.object(FeatureStore, "from_id"):
Expand Down Expand Up @@ -318,7 +324,7 @@ def test_history(self, feature_store, spark_session, get_spark_session):
@patch.object(SparkSessionSingleton, "get_spark_session")
@patch.object(OCIFeatureStore, "from_id")
def test_restore(
self, feature_store, spark_session, get_spark_session, mock_update
self, feature_store, spark_session, get_spark_session, mock_update
):
with patch.object(SparkEngine, "sql") as mock_execution_strategy:
mock_execution_strategy.return_value = None
Expand Down

0 comments on commit 806d500

Please sign in to comment.