Ejemplo n.º 1
0
def test_marc_build_field_008():
    assert marc_build_field_008() == " " * 40
    assert marc_build_field_008(
        year="2000") == "       2000                             "
    assert marc_build_field_008(
        year="2000",
        language="ger") == "       2000                        ger  "
    assert marc_build_field_008(
        year="2000", periodicity="1",
        language="ger") == "       2000          1             ger  "
    assert marc_build_field_008(
        year="2000", periodicity="1",
        language=["ger", "fre"]) == "       2000          1             ger  "
    assert marc_build_field_008(
        year="2000", periodicity="1",
        language=["ger", "fre",
                  "day"]) == "       2000          1             mul  "
    assert marc_build_field_008(
        year="20XX", periodicity="1",
        language=["ger", "fre",
                  "day"]) == "                     1             mul  "
Ejemplo n.º 2
0
    marcrecord.leader = leader

    # Identifikator
    f001 = record.field("001")
    f001 = "finc-142-" + f001
    marcrecord.add("001", data=f001)

    # Zugangsart
    f007 = formats[format]["p007"]
    marcrecord.add("007", data=f007)

    # Periodizität
    year = record.field("425", alt="")
    periodicity = formats[format]["008"]
    language = record.field("037", alt="")
    f008 = marc_build_field_008(year, periodicity, language)
    marcrecord.add("008", data=f008)

    # ISBN
    isbns = record.fields("540")
    for isbn in isbns:
        f020a = check_isbn(isbn)
        marcrecord.add("020", a=f020a)

    # ISSN
    issns = record.fields("542")
    for issn in issns:
        f022a = check_issn(issn)
        marcrecord.add("022", a=f022a)

    # Sprache