-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
47c1e6a
commit d04de81
Showing
6 changed files
with
132 additions
and
98 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import pytest | ||
from tests.harness import AsyncEtcd, ConfigScopes, HostPortPair | ||
|
||
|
||
@pytest.fixture | ||
async def etcd(): | ||
etcd = AsyncEtcd( | ||
addr=HostPortPair(host="127.0.0.1", port=2379), | ||
namespace="test", | ||
scope_prefix_map={ | ||
ConfigScopes.GLOBAL: "global", | ||
ConfigScopes.SGROUP: "sgroup/testing", | ||
ConfigScopes.NODE: "node/i-test", | ||
}, | ||
) | ||
try: | ||
await etcd.delete_prefix("", scope=ConfigScopes.GLOBAL) | ||
await etcd.delete_prefix("", scope=ConfigScopes.SGROUP) | ||
await etcd.delete_prefix("", scope=ConfigScopes.NODE) | ||
return etcd | ||
finally: | ||
await etcd.delete_prefix("", scope=ConfigScopes.GLOBAL) | ||
await etcd.delete_prefix("", scope=ConfigScopes.SGROUP) | ||
await etcd.delete_prefix("", scope=ConfigScopes.NODE) | ||
await etcd.close() | ||
del etcd | ||
|
||
|
||
@pytest.fixture | ||
async def gateway_etcd(): | ||
etcd = AsyncEtcd( | ||
addr=HostPortPair(host="127.0.0.1", port=2379), | ||
namespace="test", | ||
scope_prefix_map={ | ||
ConfigScopes.GLOBAL: "", | ||
}, | ||
) | ||
try: | ||
await etcd.delete_prefix("", scope=ConfigScopes.GLOBAL) | ||
yield etcd | ||
finally: | ||
await etcd.delete_prefix("", scope=ConfigScopes.GLOBAL) | ||
del etcd |
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