def test_gen_primes(): """See if it generates correctly the primes below 1000.""" etalon = fs.read_json(cfg.TEST_ASSETS_DIR + '/primes_below_1000.json') # li = [] primes = euler.gen_primes() for p in primes: if p > 1000: break li.append(p) # assert li == etalon
def main(): d = fs.read_json(INPUT) print_titles(d['for_business_cards'], 'Hacker Titles for Business Cards') print print_titles(d['not_really_for_business_cards'], 'And some more, not so suited for business cards')
def get_random_title(): """Returns a random hacker title.""" d = fs.read_json(INPUT) li = d['for_business_cards'] return choice(li)
def test_read_json(self): d = fs.read_json(JSON) assert d['name'] == 'Jabba Laci'