Skip to content

Commit

Permalink
refactor: rename schema_fetcher param
Browse files Browse the repository at this point in the history
  • Loading branch information
heitorlessa committed Jul 30, 2021
1 parent 4d397a7 commit a70bcd8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@


class FeatureFlags:
def __init__(self, schema_fetcher: StoreProvider):
def __init__(self, store: StoreProvider):
"""constructor
Parameters
----------
schema_fetcher: StoreProvider
store: StoreProvider
A schema JSON fetcher, can be AWS AppConfig, Hashicorp Consul etc.
"""
self._logger = logger
self._schema_fetcher = schema_fetcher
self._store = store
self._schema_validator = schema.SchemaValidator(self._logger)

def _match_by_action(self, action: str, condition_value: Any, context_value: Any) -> bool:
Expand Down Expand Up @@ -98,7 +98,7 @@ def get_configuration(self) -> Dict[str, Any]:
parsed JSON dictionary
"""
# parse result conf as JSON, keep in cache for self.max_age seconds
config = self._schema_fetcher.get_json_configuration()
config = self._store.get_json_configuration()
# validate schema
self._schema_validator.validate_json_schema(config)
return config
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/feature_toggles/test_feature_toggles.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def init_configuration_store(mocker, mock_schema: Dict, config: Config) -> Featu
cache_seconds=600,
config=config,
)
conf_store: FeatureFlags = FeatureFlags(schema_fetcher=app_conf_fetcher)
conf_store: FeatureFlags = FeatureFlags(store=app_conf_fetcher)
return conf_store


Expand Down

0 comments on commit a70bcd8

Please sign in to comment.