def test_invalid_code(self): leader = "00000cam a2200000Ia 4500" tag_008 = tag_008 = "961120s1988 nyu x 000 i eng d" self.assertIsNone(parsers.map_bib_audience_code(leader, tag_008))
def test_juvenile_code_c(self): leader = "00000cam a2200000Ia 4500" tag_008 = tag_008 = "961120s1988 nyu c 000 i eng d" self.assertEqual(parsers.map_bib_audience_code(leader, tag_008), "j")
def test_young_adult(self): leader = "00000cam a2200000Ia 4500" tag_008 = tag_008 = "961120s1988 nyu d 000 i eng d" self.assertEqual(parsers.map_bib_audience_code(leader, tag_008), "y")
def test_adult_code_empty(self): leader = "00000cam a2200000Ia 4500" tag_008 = tag_008 = "961120s1988 nyu 000 i eng d" self.assertEqual(parsers.map_bib_audience_code(leader, tag_008), "a")
def test_no_tag_008(self): leader = "00000cam a2200000Ia 4500" self.assertIsNone(parsers.map_bib_audience_code(leader, None))
def test_None(self): self.assertIsNone(parsers.map_bib_audience_code(None, None))