def test_hash_fileobj_2(tmpdir): test_fn = str(tmpdir.join("million_a.txt")) # create a file with million a's in it with open(test_fn, "wb") as test_file: for i in xrange(1000): test_file.write(1000 * "a") # check its hash with open(test_fn, "rb") as test_file: assert hashing.hash_fileobj(test_file) == million_a_digest
def test_hash_fileobj_1(): fileobj = StringIO.StringIO(million_a) assert hashing.hash_fileobj(fileobj) == million_a_digest