def METHOD_NAME(self):
    """
    Test PFN, LFN conversion when rules are chained.
    """
    tfc = TrivialFileCatalog()
    match = "/+(.*)"
    result = "/castor/cern.ch/cms/$1"
    tfc.addMapping("direct", match, result, mapping_type = "lfn-to-pfn")
    match = "(.*)"
    result = "$1"
    tfc.addMapping("stageout", match, result, chain = "direct",
                   mapping_type = "lfn-to-pfn")
    in_lfn = "/this/is/a/test/lfn"
    in_pfn = "/castor/cern.ch/cms" + in_lfn
    out_pfn = tfc.matchLFN("stageout", in_lfn)
    self.assertNotEqual(out_pfn, in_lfn)
    self.assertEqual(out_pfn, in_pfn)
    tfc = TrivialFileCatalog()
    match = "/+castor/cern\.ch/cms/(.*)"
    result = "/$1"
    tfc.addMapping("direct", match, result, mapping_type = "pfn-to-lfn")
    match = "(.*)"
    result = "$1"
    tfc.addMapping("stageout", match, result, chain = "direct",
                   mapping_type = "pfn-to-lfn")
    out_lfn = tfc.matchPFN("stageout", in_pfn)
    self.assertEqual(out_lfn, in_lfn)