Документ взят из кэша поисковой машины. Адрес оригинального документа : http://kodomo.fbb.msu.ru/hg/allpy/file/tip/test/test_pickle.py
Дата изменения: Unknown
Дата индексирования: Tue Apr 12 09:20:56 2016
Кодировка:
allpy: b556c96c6719 test/test_pickle.py

allpy

view test/test_pickle.py @ 1168:b556c96c6719

blocks3d/www Makefile: never check certificates of github, they are too confusing for wget
author Daniil Alexeyevsky <dendik@kodomo.fbb.msu.ru>
date Mon, 26 May 2014 17:20:29 +0400
parents afed1fd8920c
children
line source
1 import sys
2 import pickle
3 from StringIO import StringIO
5 def test_pickle():
6 import allpy.protein as p
7 s = p.Sequence.from_string('SEQVENCE', name='sequence')
8 file = StringIO()
9 pickle.dump(s, file)
11 del p
12 del s
13 for module in list(sys.modules):
14 if module.startswith('allpy'):
15 del sys.modules[module]
17 file.seek(0)
18 s = pickle.load(file)
19 assert s.name == 'sequence'
20 assert str(s) == 'SEQVENCE'
22 # vim: set et ts=4 sts=4 sw=4: