Exemple #1
0
def test_next_batch_id():
    with tempdir():
        os.mkdir(Constants.DEFAULT_LDIR)
        db = CsvDatabase()
        batch_id = db.next_batch_id()
        assert batch_id == 1

        batch_id = db.next_batch_id()
        assert batch_id == 2
Exemple #2
0
def test_persist():
    with tempdir():
        os.mkdir(Constants.DEFAULT_LDIR)
        db = CsvDatabase()
        db.persist()
        assert(os.path.exists(db.filename))