Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
jopemachine committed Jan 29, 2024
1 parent c76bcfa commit 6331dac
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion tests/harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ async def delete_multi(
# TODO: Test below transaction codes
actions = []
for k in keys:
actions.append(TxnOp.delete(k))
actions.append(TxnOp.delete(self._mangle_key(f"{_slash(scope_prefix)}{k}")))
txn = EtcdTransactionAction()
communicator.txn(txn.and_then(actions).or_else([]))

Expand Down
40 changes: 20 additions & 20 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,26 +179,26 @@ async def test_scope_dict(etcd: AsyncEtcd) -> None:
assert len(vp) == 0


# @pytest.mark.asyncio
# async def test_multi(etcd: AsyncEtcd) -> None:
# etcd = await etcd

# v = await etcd.get("foo")
# assert v is None
# v = await etcd.get("bar")
# assert v is None

# await etcd.put_dict({"foo": "x", "bar": "y"})
# v = await etcd.get("foo")
# assert v == "x"
# v = await etcd.get("bar")
# assert v == "y"

# await etcd.delete_multi(["foo", "bar"])
# v = await etcd.get("foo")
# assert v is None
# v = await etcd.get("bar")
# assert v is None
@pytest.mark.asyncio
async def test_multi(etcd: AsyncEtcd) -> None:
etcd = await etcd

v = await etcd.get("foo")
assert v is None
v = await etcd.get("bar")
assert v is None

await etcd.put_dict({"foo": "x", "bar": "y"})
v = await etcd.get("foo")
assert v == "x"
v = await etcd.get("bar")
assert v == "y"

await etcd.delete_multi(["foo", "bar"])
v = await etcd.get("foo")
assert v is None
v = await etcd.get("bar")
assert v is None


@pytest.mark.asyncio
Expand Down

0 comments on commit 6331dac

Please sign in to comment.