Esempio n. 1
0
def test_read_write2(tempfile, opstack):
    opstack.push(Update(0, 'name', 'z'))
    write_stack(tempfile, opstack)
    new_opstack = read_stack(tempfile)
    assert new_opstack.original_events == opstack.original_events
    assert new_opstack.events == opstack.events
    assert new_opstack.events != new_opstack.original_events
Esempio n. 2
0
 def save(self):
     'Writes out labels to file.'
     from pandas import DataFrame
     label_data = DataFrame(self.opstack.events)
     bark.write_events(self.outfile, label_data, **self.label_attrs)
     print(self.outfile, 'written')
     if self.opsfile:
         write_stack(self.opsfile, self.opstack)
         print(self.opsfile, 'written')
Esempio n. 3
0
def test_read_write(tempfile, opstack):
    write_stack(tempfile, opstack)
    new_opstack = read_stack(tempfile)
    assert new_opstack.original_events == opstack.original_events
    assert new_opstack.events == opstack.events
    assert new_opstack.events == new_opstack.original_events