diff --git a/python/hsfs/constructor/query.py b/python/hsfs/constructor/query.py index 4887d37ce8..ebf7218956 100644 --- a/python/hsfs/constructor/query.py +++ b/python/hsfs/constructor/query.py @@ -22,21 +22,20 @@ from hsfs.core import query_constructor_api, storage_connector_api from hsfs.constructor import join from hsfs.constructor.filter import Filter, Logic -from unittest.mock import MagicMock class Query: def __init__( self, - left_feature_group: MagicMock, - left_features: MagicMock, - feature_store_name: Optional[str]=None, - feature_store_id: Optional[int]=None, - left_feature_group_start_time: None=None, - left_feature_group_end_time: None=None, - joins: None=None, - filter: None=None, - ) -> None: + left_feature_group, + left_features, + feature_store_name=None, + feature_store_id=None, + left_feature_group_start_time=None, + left_feature_group_end_time=None, + joins=None, + filter=None, + ): self._feature_store_name = feature_store_name self._feature_store_id = feature_store_id self._left_feature_group = left_feature_group diff --git a/python/tests/conftest.py b/python/tests/conftest.py index f0babd241e..145f346918 100644 --- a/python/tests/conftest.py +++ b/python/tests/conftest.py @@ -1,5 +1,21 @@ +# +# Copyright 2022 Hopsworks AB +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + import pytest -from tests.fixtures.backend_fixtures import response_get_feature_group +from tests.fixtures.backend_fixtures import backend_fixtures pytest_plugins = [ "tests.fixtures.backend_fixtures", diff --git a/python/tests/fixtures/backend_fixtures.py b/python/tests/fixtures/backend_fixtures.py index c61467e2c9..ba8bece348 100644 --- a/python/tests/fixtures/backend_fixtures.py +++ b/python/tests/fixtures/backend_fixtures.py @@ -1,9 +1,25 @@ +# +# Copyright 2022 Hopsworks AB +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + import pytest import json with open('python/tests/fixtures/backend_fixtures.json', 'r') as json_file: - backend_fixtures = json.load(json_file) + backend_fixtures_json = json.load(json_file) @pytest.fixture -def response_get_feature_group(): - return backend_fixtures["get_feature_group"]["response"] \ No newline at end of file +def backend_fixtures(): + return backend_fixtures_json diff --git a/python/tests/test_feature_group.py b/python/tests/test_feature_group.py index 30db61d99a..bd2a4cffca 100644 --- a/python/tests/test_feature_group.py +++ b/python/tests/test_feature_group.py @@ -19,8 +19,8 @@ class TestFeatureGroup: - def test_from_response_json(self, response_get_feature_group): - fg = FeatureGroup.from_response_json(response_get_feature_group)[0] + def test_from_response_json(self, backend_fixtures): + fg = FeatureGroup.from_response_json(backend_fixtures["get_feature_group"]["response"])[0] assert fg.id == 15 assert len(fg._features) == 2