def test_database_reloading(db_dir): test_db = DB(db_dir, create_if_missing=True) c1 = test_db.collection('test') c1.append(5) c1.append(6) c1.delete(0) test_db.close() test_db2 = DB(db_dir) assert test_db2.collection('test')[0] == 6 assert len(test_db2.collection('test')) == 1
def test_db_schema(db_dir): test_db = DB(db_dir, create_if_missing=True) test_db.close() test_levelDB = plyvel.DB(db_dir) assert json.loads(test_levelDB.get(b'pypeline-schema-version').decode()) == schema_version