def test_sha256_sum_gives_correct_hash_for_empty_file( tmpdir_factory, text, expected_hash ): file_path = Path(str(tmpdir_factory.mktemp("sha256_example"))) / "empty.txt" file_path.write_text(text) assert file_path.sha256_sum() == expected_hash
def path_source(tmpdir_factory): path = Path(str(tmpdir_factory.mktemp("path_source") / "test.txt")) path.write_text("") return PathSource(str(path))