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

Function test_insert_string

tests/test_tinydb.py:530–545  ·  view source on GitHub ↗
(tmpdir)

Source from the content-addressed store, hash-verified

528
529
530def test_insert_string(tmpdir):
531 path = str(tmpdir.join('db.json'))
532
533 with TinyDB(path) as _db:
534 data = [{'int': 1}, {'int': 2}]
535 _db.insert_multiple(data)
536
537 with pytest.raises(ValueError):
538 _db.insert([1, 2, 3]) # Fails
539
540 with pytest.raises(ValueError):
541 _db.insert({'bark'}) # Fails
542
543 assert data == _db.all()
544
545 _db.insert({'int': 3}) # Does not fail
546
547
548def test_insert_invalid_dict(tmpdir):

Callers

nothing calls this directly

Calls 4

TinyDBClass · 0.90
insert_multipleMethod · 0.80
insertMethod · 0.80
allMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…