Exemplo n.º 1
0
 def test_add_subfield(self):
     field = Field(tag="245", indicators=[0, 1], subfields=["a", "foo"])
     field.add_subfield("a", "bar")
     self.assertEqual(field.__str__(), "=245  01$afoo$abar")
     field.add_subfield("b", "baz", 0)
     self.assertEqual(field.__str__(), "=245  01$bbaz$afoo$abar")
     field.add_subfield("c", "qux", 2)
     self.assertEqual(field.__str__(), "=245  01$bbaz$afoo$cqux$abar")
     field.add_subfield("z", "wat", 8)
     self.assertEqual(field.__str__(), "=245  01$bbaz$afoo$cqux$abar$zwat")
Exemplo n.º 2
0
 def test_add_subfield(self):
     field = Field(tag='245', indicators=[0, 1], subfields=['a', 'foo'])
     field.add_subfield('a', 'bar')
     self.assertEqual(field.__str__(), '=245  01$afoo$abar')
     field.add_subfield('b', 'baz', 0)
     self.assertEqual(field.__str__(), '=245  01$bbaz$afoo$abar')
     field.add_subfield('c', 'qux', 2)
     self.assertEqual(field.__str__(), '=245  01$bbaz$afoo$cqux$abar')
     field.add_subfield('z', 'wat', 8)
     self.assertEqual(field.__str__(), '=245  01$bbaz$afoo$cqux$abar$zwat')
Exemplo n.º 3
0
 def test_add_subfield(self):
     field = Field(tag='245', indicators=[0, 1], subfields=['a', 'foo'])
     field.add_subfield('a', 'bar')
     self.assertEqual(field.__str__(), '=245  01$afoo$abar')
Exemplo n.º 4
0
 def test_add_subfield(self):
     field = Field(tag='245', indicators=[0, 1], subfields=['a', 'foo'])
     field.add_subfield('a','bar')
     self.assertEquals(field.__str__(), '=245  01$afoo$abar')