-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from evo-company/add-dummy-managers
add dummy clients
- Loading branch information
Showing
6 changed files
with
83 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import logging | ||
from typing import Any, Callable, Dict, Optional | ||
|
||
from featureflags_client.http.constants import Endpoints | ||
from featureflags_client.http.managers.base import ( | ||
AsyncBaseManager, | ||
BaseManager, | ||
) | ||
|
||
log = logging.getLogger(__name__) | ||
|
||
|
||
class DummyManager(BaseManager): | ||
"""Dummy feature flags manager. | ||
It can be helpful when you want to use flags with their default values. | ||
""" | ||
|
||
def get(self, name: str) -> Optional[Callable[[Dict], bool]]: | ||
""" | ||
So that `featureflags.http.flags.Flags` will use default values. | ||
""" | ||
return None | ||
|
||
def sync(self) -> None: | ||
pass | ||
|
||
def preload(self) -> None: | ||
pass | ||
|
||
def _post( | ||
self, | ||
url: Endpoints, | ||
payload: Dict[str, Any], | ||
timeout: int, | ||
) -> Dict[str, Any]: | ||
pass | ||
|
||
|
||
class AsyncDummyManager(AsyncBaseManager): | ||
"""Dummy feature flags manager for asyncio apps. | ||
It can be helpful when you want to use flags with their default values. | ||
""" | ||
|
||
def get(self, name: str) -> Optional[Callable[[Dict], bool]]: | ||
""" | ||
So that `featureflags.http.flags.Flags` will use default values. | ||
""" | ||
return None | ||
|
||
async def _post( # type: ignore | ||
self, | ||
url: Endpoints, | ||
payload: Dict[str, Any], | ||
timeout: int, | ||
) -> Dict[str, Any]: | ||
pass | ||
|
||
async def close(self) -> None: | ||
pass | ||
|
||
async def sync(self) -> None: # type: ignore | ||
pass | ||
|
||
async def preload(self) -> None: # type: ignore | ||
pass | ||
|
||
def start(self) -> None: | ||
pass | ||
|
||
async def wait_closed(self) -> None: | ||
pass |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.