def testAllowed(self):
        idf = id.StringIDFilter("visit", "the quick brown".split())
        self.assert_(idf.hasStaticValueSet())
        self.assert_(not idf.isUnconstrained())

        vals = idf.allowedValues()
        self.assertEquals(len(vals), 3)
        self.assertEquals(vals[0], "brown")
        self.assertEquals(vals[1], "quick")
        self.assertEquals(vals[2], "the")
    def testValues3(self, idf=None):
        if not idf:
            idf = id.StringIDFilter("visit", values="r")
        self.assertEquals(idf.name, "visit")

        self.assert_(not idf.isUnconstrained())
        self.assert_(idf.recognize(-1) is None)
        self.assert_(idf.recognize("") is None)
        self.assert_(idf.recognize("b") is None)
        self.assertEquals(idf.recognize("r"), "r")
        self.assert_(idf.recognize(0) is None)
        self.assert_(idf.recognize(15) is None)
    def testValues1(self, idf=None):
        if not idf:
            idf = id.StringIDFilter("visit", values="3 0 15 14 4 5".split())
        self.assertEquals(idf.name, "visit")

        self.assert_(idf.recognize(-1) is None)
        self.assert_(idf.recognize("-1") is None)
        self.assert_(idf.recognize("50") is None)
        self.assertEquals(idf.recognize(3), "3")
        self.assertEquals(idf.recognize("0"), "0")
        self.assertEquals(idf.recognize("15"), "15")
        self.assert_(idf.recognize("16") is None)
    def testNoConstraints(self, idf=None):
        if not idf:
            idf = id.StringIDFilter("visit")
        self.assert_(idf.isUnconstrained())
        self.assertEquals(idf.name, "visit")
        self.assertEquals(idf.outname, "visit")

        self.assert_(idf.recognize(2), "2")
        self.assert_(idf.recognize(-1), "-1")
        self.assert_(idf.recognize("-1"), "-1")
        self.assert_(idf.recognize("50"), "50")
        self.assert_(idf.recognize(3), "3")
    def testValues2(self, idf=None):
        if not idf:
            idf = id.StringIDFilter("visit", "r 6,0 -8".split())
        self.assertEquals(idf.name, "visit")

        self.assert_(not idf.isUnconstrained())
        self.assert_(idf.recognize(-1) is None)
        self.assert_(idf.recognize("-1") is None)
        self.assert_(idf.recognize("50") is None)
        self.assertEquals(idf.recognize("r"), "r")
        self.assert_(idf.recognize("0") is None)
        self.assert_(idf.recognize("zub") is None)
        self.assertEquals(idf.recognize("6,0"), "6,0")
        self.assertEquals(idf.recognize("-8"), "-8")
        self.assert_(idf.recognize("16") is None)