- fragments_text = u"\n\n".join(u"%s: %s\n%s" % (f.id, f.themes, f) for f in closed_fragments.values())
- assert_equal(fragments_text, file(expected_output_file_path).read().decode('utf-8'))
+ fragments_text = u"\n\n".join(u"%s: %s\n%s" % (f.id, f.themes, f) for f in sorted(closed_fragments.values(), key=lambda f: f.id))
+ assert_equal(fragments_text, open(expected_output_file_path, 'rb').read().decode('utf-8'))