Debian Codegraph @

tests/api/test_txn.py

raw symbols SCIP
1 import base64
2
3
4 class TestTxn:
5 def test_transaction(self, consul_obj) -> None:
6 c, _consul_version = consul_obj
7 value = base64.b64encode(b"1").decode("utf8")
8 d = {"KV": {"Verb": "set", "Key": "asdf", "Value": value}}
9 r = c.txn.put([d])
10 assert r["Errors"] is None
11
12 d = {"KV": {"Verb": "get", "Key": "asdf"}}
13 r = c.txn.put([d])
14 assert r["Results"][0]["KV"]["Value"] == value