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