MCPcopy
hub / github.com/msiemens/tinydb / test_insert

Function test_insert

tests/test_tinydb.py:30–43  ·  view source on GitHub ↗
(db: TinyDB)

Source from the content-addressed store, hash-verified

28
29
30def test_insert(db: TinyDB):
31 db.drop_tables()
32 db.insert({'int': 1, 'char': 'a'})
33
34 assert db.count(where('int') == 1) == 1
35
36 db.drop_tables()
37
38 db.insert({'int': 1, 'char': 'a'})
39 db.insert({'int': 1, 'char': 'b'})
40 db.insert({'int': 1, 'char': 'c'})
41
42 assert db.count(where('int') == 1) == 3
43 assert db.count(where('char') == 'a') == 1
44
45
46def test_insert_ids(db: TinyDB):

Callers

nothing calls this directly

Calls 4

whereFunction · 0.90
drop_tablesMethod · 0.80
insertMethod · 0.80
countMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…