(tmpdir)
| 684 | |
| 685 | |
| 686 | def test_insert_on_existing_db(tmpdir): |
| 687 | path = str(tmpdir.join('db.json')) |
| 688 | |
| 689 | db = TinyDB(path, ensure_ascii=False) |
| 690 | db.insert({'foo': 'bar'}) |
| 691 | |
| 692 | assert len(db) == 1 |
| 693 | |
| 694 | db.close() |
| 695 | |
| 696 | db = TinyDB(path, ensure_ascii=False) |
| 697 | db.insert({'foo': 'bar'}) |
| 698 | db.insert({'foo': 'bar'}) |
| 699 | |
| 700 | assert len(db) == 3 |
| 701 | |
| 702 | |
| 703 | def test_storage_access(): |