def test_flexible_open_string_file_like(tmp_file): """File-like objects support read methods should have their content returned by flexible_open_string.""" fname = tmp_file(MULTILINE_HIPSTER_IPSUM) with open(fname) as fp: returned_string = flexible_open_string(fp) assert returned_string == MULTILINE_HIPSTER_IPSUM
def test_flexible_open_string_path_like(tmp_file): """Path-like strings should be opened, read and returned""" fname = tmp_file(MULTILINE_HIPSTER_IPSUM) returned_string = flexible_open_string(fname) assert returned_string == MULTILINE_HIPSTER_IPSUM
def test_flexible_open_string_raw_string(): """Raw multiline strings should be directly returned by flexible_open_string.""" returned_string = flexible_open_string(MULTILINE_HIPSTER_IPSUM) assert returned_string == MULTILINE_HIPSTER_IPSUM