def test_guess_filename_with_default() -> None: assert (helpers.guess_filename(None, 'no-throw') == 'no-throw')
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)
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)
def test_guess_filename_with_default() -> None: assert helpers.guess_filename(None, "no-throw") == "no-throw"
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
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
def test_guess_filename_with_tempfile() -> None: with tempfile.TemporaryFile() as fp: assert (helpers.guess_filename(fp, 'no-throw') is not None)
def test_guess_filename_with_tempfile(): with tempfile.TemporaryFile() as fp: assert (helpers.guess_filename(fp, 'no-throw') is not None)