(tmpdir)
| 528 | |
| 529 | |
| 530 | def 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 | |
| 548 | def test_insert_invalid_dict(tmpdir): |
nothing calls this directly
no test coverage detected
searching dependent graphs…