Ejemplo n.º 1
0
def test_guess_filename_with_default() -> None:
    assert (helpers.guess_filename(None, 'no-throw') == 'no-throw')
Ejemplo n.º 2
0
def test_guess_filename_with_file_object(tmp_path) -> None:
    file_path = tmp_path / 'test_guess_filename'
    with file_path.open('w+b') as fp:
        assert (helpers.guess_filename(fp, 'no-throw') is not None)
Ejemplo n.º 3
0
def test_guess_filename_with_path(tmp_path) -> None:
    file_path = tmp_path / 'test_guess_filename'
    assert (helpers.guess_filename(file_path, 'no-throw') is not None)
Ejemplo n.º 4
0
def test_guess_filename_with_default() -> None:
    assert helpers.guess_filename(None, "no-throw") == "no-throw"
Ejemplo n.º 5
0
def test_guess_filename_with_path(tmp_path) -> None:
    file_path = tmp_path / "test_guess_filename"
    assert helpers.guess_filename(file_path, "no-throw") is not None
Ejemplo n.º 6
0
def test_guess_filename_with_file_object(tmp_path) -> None:
    file_path = tmp_path / "test_guess_filename"
    with file_path.open("w+b") as fp:
        assert helpers.guess_filename(fp, "no-throw") is not None
Ejemplo n.º 7
0
def test_guess_filename_with_tempfile() -> None:
    with tempfile.TemporaryFile() as fp:
        assert (helpers.guess_filename(fp, 'no-throw') is not None)
Ejemplo n.º 8
0
def test_guess_filename_with_tempfile():
    with tempfile.TemporaryFile() as fp:
        assert (helpers.guess_filename(fp, 'no-throw') is not None)