示例#1
0
def test_historyHDF5_from_archive():

    sheet = Sheet("3", *three_faces_sheet())
    history = HistoryHdf5(sheet, hf5file="test.hf5")
    history.record()
    history.record()
    history.record()

    retrieved = HistoryHdf5.from_archive("test.hf5")
    try:
        assert isinstance(retrieved.sheet, type(sheet))
    finally:
        os.remove("test.hf5")
示例#2
0
def test_to_and_from_archive():

    sheet = Sheet("3", *three_faces_sheet())
    history = History(sheet)
    history.record()
    history.record()
    history.record()
    history.to_archive("test.hf5")
    history_h = HistoryHdf5.from_archive("test.hf5")
    sheet_ = history_h.retrieve(2)
    try:
        assert sheet_.Nv == sheet.Nv
    finally:
        os.remove("test.hf5")