def test_index_wikis(self): self._insert_component('comp16') self._insert_component('comp20') wiki1 = WikiPage(self.env, name="Testwiki1", version="1") wiki1.text = "This is the wiki <comp20 open door> text content." wiki1.save('adeponte', 'My comment', '192.168.1.2') wiki2 = WikiPage(self.env, name="Testwiki2", version="1") wiki2.text = "This is the wiki <comp16 close door> text content." wiki2.save('bob', 'His Comment', '182.123.321.456') req_cache_sys = RequirementCacheSystem(self.env) req_cache_sys.index_wikis() req_wiki_cache = RequirementWikiCache(self.env, 'comp20', 'open', 'door', 'Testwiki1', '1') self.assertEqual(req_wiki_cache.exists, True) req_wiki_cache = RequirementWikiCache(self.env, 'comp16', 'close', 'door', 'Testwiki2', '1') self.assertEqual(req_wiki_cache.exists, True)
def test_index_tickets(self): self._insert_component('comp4') self._insert_component('comp5') self._insert_component('comp6') ticket1 = Ticket(self.env) ticket1['reporter'] = 'santa' ticket1['summary'] = 'the num 1 summary' ticket1['description'] = '<comp5 pet cat>' ticket1['keywords'] = '<comp6 do things>' ticket1.insert() ticket2 = Ticket(self.env) ticket2['reporter'] = 'bob' ticket2['summary'] = 'the number 2 summary' ticket2['description'] = 'The desc requirement:comp4-feed-cat foo' ticket2['keywords'] = 'foo bar kitty' ticket2.insert() req_cache_sys = RequirementCacheSystem(self.env) req_cache_sys.index_tickets() req_ticket_cache = RequirementTicketCache(self.env, ticket1.id, 'comp5', 'pet', 'cat') self.assertEqual(req_ticket_cache.exists, True) req_ticket_cache = RequirementTicketCache(self.env, ticket1.id, 'comp6', 'do', 'things') self.assertEqual(req_ticket_cache.exists, True) req_ticket_cache = RequirementTicketCache(self.env, ticket2.id, 'comp4', 'feed', 'cat') self.assertEqual(req_ticket_cache.exists, True)