Ejemplo n.º 1
0
 def testPFN(self):
     "Should be able to add/remove/has PFNs"
     c = CatalogType("name")
     p = PFN("url", "site")
     self.assertFalse(c.hasPFN(p))
     c.addPFN(p)
     self.assertRaises(DuplicateError, c.addPFN, p)
     self.assertTrue(c.hasPFN(p))
     c.removePFN(p)
     self.assertFalse(c.hasPFN(p))
     self.assertRaises(NotFoundError, c.removePFN, p)
     c.addPFN(p)
     c.clearPFNs()
     self.assertFalse(c.hasPFN(p))