@testhelp.context('trove-filter')
    def testBadTroveFilters(self):
        recipe = self.getRecipe()
        filt = trovefilter.AbstractFilter()
        self.assertRaises(NotImplementedError, filt.match)

        try:
            filt = trovefilter.TroveFilter(recipe, 'foo(')
        except __HOLE__, e:
            self.assertEquals(str(e), "Bad Regexp: 'foo(' for name")
        else:
            self.fail("Expected RuntimeError")

        nvf = cmdline.parseTroveSpec('foo=/test.rpath.local@rpl:devel')
        filt = trovefilter.TroveFilter(recipe, 'foo')
        self.assertEquals(filt.match((nvf,)), True)
        filt.compile()
        filt.versionType = True
        filt.version = 'foo'
        self.assertEquals(filt.match((nvf,)), False)
dataset/ETHPy150Open sassoftware/conary/conary_test/cvctest/buildtest/expansiontest.py/TroveFilterTest.testBadTroveFilters