#!/usr/bin/python from framework import * ############################# init #################################### frm = framework() frm.prompt = "frmwrk>" frm.banner = """ +-----------------------------+ [ ] [ ] +-----------------------------+ """ #############################commands#################################### frm.addCommand("exit", """ self.put("warning","Exiting now...") exit(0) ""","Exit the framework", False) frm.addCommand("use", """ self.variantPrompt = "(%s%s%s%s)"%(self.blue,self.bold,self.cmdArgs[0],self.reset)
C = self.catalog; eval = C.evalAdvancedQuery rl = []; c = C._catalog for r in eval(all, (ranker(*rs), 'I1', 'I2')): rl.append(c.paths[r.data_record_id_]) rl.append(`r.data_record_score_[0]`) self.assertEqual(''.join(rl), should) class TestAdvancedQuery_Field(TestAdvancedQuery): _indexType = 'FieldIndex' class TestMatching(TestCase): _stringType = 1 def testGlob(self): self._checkQuery(MatchGlob('I1','*'), '12346') def testRegexp(self): self._checkQuery(MatchRegexp('I1','.'), '12346') def test_suite(): return getSuite(TestAdvancedQuery, TestAdvancedQuery_Field, TestAdvancedQuery_ReverseOrder, TestIndexIndependant, TestMatching, ) if __name__ == '__main__': framework()