Test basic insert and retrieval
(name)
| 137 | # ============== TESTS ============== |
| 138 | |
| 139 | def test_basic_upsert_lookup(name): |
| 140 | """Test basic insert and retrieval""" |
| 141 | print("\n[Test: Basic Upsert/Lookup]") |
| 142 | |
| 143 | def do_upsert(txn_id): |
| 144 | upsert(name, txn_id, "key1", "value1") |
| 145 | upsert(name, txn_id, "key2", "value2") |
| 146 | |
| 147 | run_in_txn(name, do_upsert) |
| 148 | |
| 149 | v1 = lookup(name, "key1") |
| 150 | v2 = lookup(name, "key2") |
| 151 | |
| 152 | if v1 == "value1": |
| 153 | results.ok("key1 lookup") |
| 154 | else: |
| 155 | results.fail("key1 lookup", "value1", v1) |
| 156 | |
| 157 | if v2 == "value2": |
| 158 | results.ok("key2 lookup") |
| 159 | else: |
| 160 | results.fail("key2 lookup", "value2", v2) |
| 161 | |
| 162 | def test_unicode_content(name): |
| 163 | """Test Unicode characters in keys and values""" |
no test coverage detected