示例#1
0
 def _is_unused(self, keyword):
     try:
         self._controller.execute(
             FindUsages(keyword.name, keyword_info=keyword.info)).next()
         return False
     except StopIteration:
         return True
示例#2
0
 def _find_usages(self):
     return self._controller.execute(FindUsages(self._name, self._kw_info))
示例#3
0
 def _assert_no_usages(self, keyword):
     self.assertEqual(list(self.ts2.execute(FindUsages(keyword))), [])
示例#4
0
 def _assert_usage(self, keyword, usage):
     occ = list(self.ts2.execute(FindUsages(keyword)))
     self.assertEqual(len(occ), 1)
     self.assertEqual(occ[0].usage, usage)