def __check_gold(self, maxb, maxp, primes): results = set() search = beal.search(maxb, maxp, primes) for a in range(1, maxb+1): hits = search.search(a) results.update(set(hits)) self.assertEqual(results, self.__get_gold(maxb, maxp))
def setup_context(work_spec): global search max_base = work_spec['max_base'] max_pow = work_spec['max_pow'] primes = work_spec['primes'] if not search: search = beal.search(max_base, max_pow, primes) return assert max_base == search.max_base() assert max_pow == search.max_pow() assert primes == search.primes()