MCPcopy
hub / github.com/jazzband/django-constance / test_async_set

Method test_async_set

tests/test_async.py:15–25  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

13 self.assertEqual(val, 1)
14
15 async def test_async_set(self):
16 await config.aset("INT_VALUE", 42)
17 val = await config.INT_VALUE
18 self.assertEqual(val, 42)
19
20 # Verify sync access also works (and emits warning)
21 with warnings.catch_warnings(record=True) as w:
22 warnings.simplefilter("always")
23 sync_val = int(config.INT_VALUE)
24 self.assertEqual(sync_val, 42)
25 self.assertTrue(any("Synchronous access" in str(warn.message) for warn in w))
26
27 async def test_amget(self):
28 values = await config.amget(["INT_VALUE", "BOOL_VALUE"])

Callers

nothing calls this directly

Calls 1

asetMethod · 0.45

Tested by

no test coverage detected