fix bug introduced by file.read(), which limits to 1024; revise unittest