def test_filter_subject_headings_bpl_other(stub_marc_bib): record = stub_marc_bib assert "655" not in record record.add_field( pymarc.field.Field( tag="655", indicators=[" ", "7"], subfields=["a", "LOCAL heading", "2", "local"], ) ) assert "655" in record output = filter_subject_headings(record, 2) assert type(output) is list assert output == []
def test_filter_subject_headings_bpl_children_lcsh(stub_marc_bib): record = stub_marc_bib assert "650" not in record record.add_field( pymarc.field.Field( tag="650", indicators=[" ", "1"], subfields=["a", "Children LCSH heading"], ) ) assert "650" in record output = filter_subject_headings(record, 2) assert type(output) is list assert output == []
def test_filter_subject_headings_bpl_lcgft(stub_marc_bib): record = stub_marc_bib assert "655" not in record record.add_field( pymarc.field.Field( tag="655", indicators=[" ", "7"], subfields=["a", "LCGFT heading", "2", "lcgft"], ) ) assert "655" in record output = filter_subject_headings(record, 2) assert type(output) is list assert type(output[0]) == pymarc.field.Field assert str(output[0]) == "=655 \\7$aLCGFT heading$2lcgft"
def test_filter_subject_headings_bpl_lcsh(stub_marc_bib): record = stub_marc_bib assert "650" not in record record.add_field( pymarc.field.Field( tag="650", indicators=[" ", "0"], subfields=["a", "LCSH heading"], ) ) assert "650" in record output = filter_subject_headings(record, 2) assert type(output) is list assert type(output[0]) == pymarc.field.Field assert str(output[0]) == "=650 \\0$aLCSH heading"
def test_filter_subject_headings_nyp_fast(stub_marc_bib): record = stub_marc_bib assert "655" not in record record.add_field( pymarc.field.Field( tag="655", indicators=[" ", "7"], subfields=["a", "FAST heading", "2", "fast"], ) ) assert "655" in record output = filter_subject_headings(record, 1) assert type(output) is list assert type(output[0]) == pymarc.field.Field assert str(output[0]) == "=655 \\7$aFAST heading$2fast"
def test_filter_subject_headings_nyp_children_lcsh(stub_marc_bib): record = stub_marc_bib assert "650" not in record record.add_field( pymarc.field.Field( tag="650", indicators=[" ", "1"], subfields=["a", "Children's LCSH heading"], ) ) assert "650" in record output = filter_subject_headings(record, 1) assert type(output) is list assert type(output[0]) == pymarc.field.Field assert str(output[0]) == "=650 \\1$aChildren's LCSH heading"