Exemplo n.º 1
0
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
Exemplo n.º 2
0
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
Exemplo n.º 3
0
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