Пример #1
0
 def test_nypl_research_full_no_order(self):
     tag = Field(tag="852",
                 indicators=["8", " "],
                 subfields=["h", "ReCAP 0001"])
     self.n_marc.add_ordered_field(tag)
     meta = bibs.InhouseBibMeta(self.n_marc)
     self.assertEqual(meta.ownLibrary, "research")
Пример #2
0
 def test_bpl_ownLibrary_full(self):
     tag = Field(tag="099",
                 indicators=[" ", " "],
                 subfields=["a", "FIC", "a", "ADAMS"])
     self.b_marc.add_ordered_field(tag)
     meta = bibs.InhouseBibMeta(self.b_marc)
     self.assertEqual(meta.ownLibrary, "branches")
Пример #3
0
 def test_nypl_branch_full_no_order(self):
     tag = Field(tag="091",
                 indicators=[" ", " "],
                 subfields=["f", "FIC", "a", "ADAMS"])
     self.n_marc.add_ordered_field(tag)
     meta = bibs.InhouseBibMeta(self.n_marc)
     self.assertEqual(meta.ownLibrary, "branches")
Пример #4
0
 def test_nypl_mixed_branch_full_research_order(self):
     tag = Field(tag="091",
                 indicators=[" ", " "],
                 subfields=["f", "FIC", "a", "ADAMS"])
     self.n_marc.add_ordered_field(tag)
     locs = ["xxx"]
     meta = bibs.InhouseBibMeta(self.n_marc, locations=locs)
     self.assertEqual(meta.ownLibrary, "mixed")
Пример #5
0
    def test_nypl_mixed_research_full_branch_order(self):
        tag = Field(tag="852",
                    indicators=["8", " "],
                    subfields=["h", "ReCAP 0001"])
        self.n_marc.add_ordered_field(tag)

        locs = ["zzzzz"]

        meta = bibs.InhouseBibMeta(self.n_marc, locations=locs)
        self.assertEqual(meta.ownLibrary, "mixed")
Пример #6
0
    def test_nypl_mixed_full_no_order(self):
        tag = Field(tag="852",
                    indicators=["8", " "],
                    subfields=["h", "ReCAP 0001"])
        self.n_marc.add_ordered_field(tag)

        tag = Field(tag="091",
                    indicators=[" ", " "],
                    subfields=["f", "FIC", "a", "ADAMS"])
        self.n_marc.add_ordered_field(tag)

        meta = bibs.InhouseBibMeta(self.n_marc)
        self.assertEqual(meta.ownLibrary, "mixed")
Пример #7
0
 def test_bpl_ownLibrary_order(self):
     meta = bibs.InhouseBibMeta(self.b_marc)
     self.assertIsNone(meta.ownLibrary)
Пример #8
0
 def test_nypl_ownLibrary_research_sc_loc(self):
     locs = ["sc"]
     meta = bibs.InhouseBibMeta(self.n_marc, locations=locs)
     self.assertEqual(meta.ownLibrary, "research")
Пример #9
0
 def test_nypl_ownLibrary_research_my_locs(self):
     locs = ["myd", "myh", "mym", "myt"]
     meta = bibs.InhouseBibMeta(self.n_marc, locations=locs)
     self.assertEqual(meta.ownLibrary, "research")
Пример #10
0
 def test_nypl_ownLibrary_branches_my_locs(self):
     locs = ["mya0n", "mya0v", "myj0f"]
     meta = bibs.InhouseBibMeta(self.n_marc, locations=locs)
     self.assertEqual(meta.ownLibrary, "branches")
Пример #11
0
 def test_nypl_ownLibrary_branch_locs_only(self):
     locs = sierra_dicts.NYPL_BRANCHES.keys()
     locs.remove("ma")
     locs.remove("sc")
     meta = bibs.InhouseBibMeta(self.n_marc, locations=locs)
     self.assertEqual(meta.ownLibrary, "branches")
Пример #12
0
 def test_nypl_ownLibrary_mixed_explicit_ma(self):
     locs = ["mya0n", "mal"]
     meta = bibs.InhouseBibMeta(self.n_marc, locations=locs)
     self.assertEqual(meta.ownLibrary, "mixed")
Пример #13
0
 def test_nypl_ownLibrary_mixed_order(self):
     locs = ["zzzzz", "xxx"]
     meta = bibs.InhouseBibMeta(self.n_marc, locations=locs)
     self.assertEqual(meta.ownLibrary, "mixed")
Пример #14
0
 def test_nypl_ownLibrary_zzzzz(self):
     locs = ["zzzzz"]
     meta = bibs.InhouseBibMeta(self.n_marc, locations=locs)
     self.assertEqual(meta.ownLibrary, "branches")
Пример #15
0
    def test_nypl_ownLibrary_no_locations(self):
        locs = []

        meta = bibs.InhouseBibMeta(self.n_marc, locations=locs)
        self.assertIsNone(meta.ownLibrary)