Created
October 28, 2011 13:24
-
-
Save gugek/1322248 to your computer and use it in GitHub Desktop.
test_writing_unicode_leader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test_writing_unicode_leader(self): | |
"""Test serializing a record with a unicode leader""" | |
record = Record() | |
record.add_field(Field(245, ['1', '0'], ['a', unichr(0x1234)])) | |
record.leader = u' a ' | |
writer = MARCWriter(open('test/foo', 'w')) | |
writer.write(record) | |
writer.close() | |
reader = MARCReader(open('test/foo'), to_unicode=True) | |
record = reader.next() | |
self.assertEqual(record['245']['a'], unichr(0x1234)) | |
os.remove('test/foo') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment