|
| 1 | +# Copyright 2022 Google LLC |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# https://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +import create_feature_sample |
| 16 | +import test_constants as constants |
| 17 | + |
| 18 | + |
| 19 | +def test_create_feature_sample(mock_sdk_init, mock_create_feature): |
| 20 | + |
| 21 | + create_feature_sample.create_feature_sample( |
| 22 | + project=constants.PROJECT, |
| 23 | + location=constants.LOCATION, |
| 24 | + feature_id=constants.FEATURE_ID, |
| 25 | + value_type=constants.FEATURE_VALUE_TYPE, |
| 26 | + entity_type_id=constants.ENTITY_TYPE_ID, |
| 27 | + featurestore_id=constants.FEATURESTORE_ID, |
| 28 | + ) |
| 29 | + |
| 30 | + mock_sdk_init.assert_called_once_with( |
| 31 | + project=constants.PROJECT, location=constants.LOCATION |
| 32 | + ) |
| 33 | + |
| 34 | + mock_create_feature.assert_called_once_with( |
| 35 | + feature_id=constants.FEATURE_ID, |
| 36 | + value_type=constants.FEATURE_VALUE_TYPE, |
| 37 | + entity_type_name=constants.ENTITY_TYPE_ID, |
| 38 | + featurestore_id=constants.FEATURESTORE_ID, |
| 39 | + ) |
0 commit comments