We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 193e49f commit d86fb47Copy full SHA for d86fb47
tests/test_glom_writing.py
@@ -1,3 +1,5 @@
1
+import pytest
2
+
3
import dictdatabase as DDB
4
5
data = {
@@ -15,3 +17,11 @@ def test_glom_writing():
15
17
purchase["status"] = "cancelled"
16
18
session.write()
19
assert DDB.at("users", key="users.Ben.status").read() == "cancelled"
20
21
22
+def test_glom_writing_sub_key_not_exists():
23
+ DDB.at("users").create(data, force_overwrite=True)
24
+ with pytest.raises(KeyError):
25
+ with DDB.at("users", key="users.SUBKEY").session() as (session, purchase):
26
+ purchase["status"] = "cancelled"
27
+ session.write()
0 commit comments