(tmp_dir, dvc)
| 6 | |
| 7 | |
| 8 | def test_state(tmp_dir, dvc): |
| 9 | tmp_dir.gen("foo", "foo content") |
| 10 | path = tmp_dir / "foo" |
| 11 | hash_info = HashInfo("md5", file_md5(path, dvc.fs)) |
| 12 | |
| 13 | state = State(dvc.root_dir, dvc.tmp_dir, dvc.dvcignore) |
| 14 | |
| 15 | state.save(str(path), dvc.fs, hash_info) |
| 16 | assert state.get(str(path), dvc.fs)[1] == hash_info |
| 17 | |
| 18 | path.unlink() |
| 19 | path.write_text("1") |
| 20 | |
| 21 | assert state.get(str(path), dvc.fs) == (None, None) |
| 22 | |
| 23 | hash_info = HashInfo("md5", file_md5(path, dvc.fs)) |
| 24 | state.save(str(path), dvc.fs, hash_info) |
| 25 | |
| 26 | assert state.get(str(path), dvc.fs)[1] == hash_info |
| 27 | |
| 28 | |
| 29 | def test_state_overflow(tmp_dir, dvc): |
nothing calls this directly
no test coverage detected