Skip to content
This repository has been archived by the owner on Mar 19, 2020. It is now read-only.

Commit

Permalink
add a failing test for bad (i.e., non-ASCII) subfield code.
Browse files Browse the repository at this point in the history
[I think this is the problem in edsu#89
and not really specific to Harvard Open Metadata]
  • Loading branch information
Wooble committed Jul 3, 2019
1 parent 74095eb commit d28e621
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/bad_subfield_code.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
00755cam 22002414a 4500001001300000003000600013005001700019008004100036010001700077020004300094040001800137042000800155050002600163082001700189100003100206245005400237260004200291300007200333500003300405650003700438630002500475630001300500fol05731351 IMchF20000613133448.0000107s2000 nyua 001 0 eng  a 00020737  a0471383147 (paper/cd-rom : alk. paper) aDLCcDLCdDLC apcc00aQA76.73.P22bM33 200000a005.13/32211 aMartinsson, Tobias,d1976-10áActivePerl with ASP and ADO /cTobias Martinsson. aNew York :bJohn Wiley & Sons,c2000. axxi, 289 p. :bill. ;c23 cm. +e1 computer laser disc (4 3/4 in.) a"Wiley Computer Publishing." 0aPerl (Computer program language)00aActive server pages.00aActiveX.
6 changes: 6 additions & 0 deletions test/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ def disabled_test_codecs(self):
record = next(reader)
self.assertEqual(record['245']['a'], u'ActivePerl with ASP and ADO /')

def test_bad_subfield(self):
with open('test/bad_subfield_code.dat', 'rb') as fh:
reader = pymarc.MARCReader(fh)
record = next(reader)
self.assertEqual(record['245']['a'], u'ActivePerl with ASP and ADO /')

def test_bad_indicator(self):
with open('test/bad_indicator.dat', 'rb') as fh:
reader = pymarc.MARCReader(fh)
Expand Down

0 comments on commit d28e621

Please sign in to comment.