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

Function test_multiple_tables

tests/test_tables.py:32–49  ·  view source on GitHub ↗
(db)

Source from the content-addressed store, hash-verified

30
31
32def test_multiple_tables(db):
33 table1 = db.table('table1')
34 table2 = db.table('table2')
35 table3 = db.table('table3')
36
37 table1.insert({'int': 1, 'char': 'a'})
38 table2.insert({'int': 1, 'char': 'b'})
39 table3.insert({'int': 1, 'char': 'c'})
40
41 assert table1.count(where('char') == 'a') == 1
42 assert table2.count(where('char') == 'b') == 1
43 assert table3.count(where('char') == 'c') == 1
44
45 db.drop_tables()
46
47 assert len(table1) == 0
48 assert len(table2) == 0
49 assert len(table3) == 0
50
51
52def test_caching(db):

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…