@testing.requires_testing_data
def test_label_io():
 tempdir = _TempDir()
 label = read_label(label_fname)
 assert_equal(label.name, 'test-lh')
 assert_is(label.subject, None)
 assert_is(label.color, None)
 label.save(op.join(tempdir, 'foo'))
 label2 = read_label(op.join(tempdir, 'foo-lh.label'))
 assert_labels_equal(label, label2)
 dest = op.join(tempdir, 'foo.pickled')
 with open(dest, 'wb') as fid:
  pickle.dump(label, fid, pickle.HIGHEST_PROTOCOL)
 with open(dest, 'rb') as fid:
  label2 = pickle.load(fid)
 assert_labels_equal(label, label2)

@ testing . requires_testing_data def test_label_io ( ) : tempdir = _TempDir ( ) label = read_label ( label_fname ) assert_equal ( label . name , 'test-lh' ) assert_is ( label . subject , None ) assert_is ( label . color , None ) label . save ( op . join ( tempdir , 'foo' ) ) label2 = read_label ( op . join ( tempdir , 'foo-lh.label' ) ) assert_labels_equal ( label , label2 ) dest = op . join ( tempdir , 'foo.pickled' ) with open ( dest , 'wb' ) as fid : pickle . dump ( label , fid , pickle . HIGHEST_PROTOCOL ) with open ( dest , 'rb' ) as fid : label2 = pickle . load ( fid ) assert_labels_equal ( label , label2 )
test io of label files .