Skip to content
This repository
Browse code

adding new test data for isbn code, and additional test code

  • Loading branch information...
commit 3d1b15c6cd68fcfffb09197c71057885fd041792 1 parent 4b698ce
Mx A. Matienzo anarchivist authored

Showing 2 changed files with 11 additions and 0 deletions. Show diff stats Hide diff stats

  1. +1 0  test/multi_isbn.dat
  2. +10 0 test/record.py
1  test/multi_isbn.dat
... ... @@ -0,0 +1 @@
  1 +00794pam a2200241 i 4500001000800000005001700008008004100025035002100066906004500087010001700132020002200149020003300171020002900204040001800233050002500251082002500276100002700301245007400328260004900402300002800451490002200479991005100501461219520050208133419.0771025s1977 vtua 000 0 eng  9(DLC) 77017192 a7bcbccorignewd1eocipf19gy-gencatlg a 77017192  a0914378287 (v. 1) a0914378295 (lim. ed.) (v. 1) a0914378260 (pbk.) (v. 1) aDLCcDLCdDLC00aPS3569.H44bW3 pt. 100a811/.5/4 sa811/.5/41 aJohnson, Judith Emlyn.14aThe town scold /cby Judith Johnson Sherwin ; ill. by Margaret Lampe. aTaftsville, Vt. :bCountryman Press,cc1977. a39 p. :bill. ;c23 cm.0 aHer Waste ; pt. 1 bc-GenCollhPS3569.H44iW3 pt. 1tCopy 1wBOOKS
10 test/record.py
... ... @@ -1,5 +1,6 @@
1 1 import unittest
2 2
  3 +from pymarc.reader import MARCReader
3 4 from pymarc.record import Record
4 5 from pymarc.field import Field
5 6 from pymarc.exceptions import BaseAddressInvalid, RecordLeaderInvalid
@@ -97,6 +98,15 @@ def test_isbn(self):
97 98 record = Record()
98 99 record.add_field(Field('020', [0, 1], subfields=['a', 'ISBN-978-1416566113']))
99 100 self.assertEquals(record.isbn(), '9781416566113')
  101 +
  102 + record = Record()
  103 + record.add_field(Field('020', [' ', ' '], subfields=['a', '0456789012 (reel 1)']))
  104 + self.assertEquals(record.isbn(), '0456789012')
  105 +
  106 + def test_multiple_isbn(self):
  107 + reader = MARCReader(file('test/multi_isbn.dat'))
  108 + record = reader.next()
  109 + self.assertEquals(record.isbn(), '0914378287')
100 110
101 111 def test_author(self):
102 112 record = Record()

0 comments on commit 3d1b15c

Please sign in to comment.
Something went wrong with that request. Please try again.