| 129 | |
| 130 | |
| 131 | def test_commit_granular_output(tmp_dir, dvc): |
| 132 | dvc.run( |
| 133 | name="mystage", |
| 134 | cmd=[ |
| 135 | "python -c \"open('foo', 'wb').write(b'foo\\n')\"", |
| 136 | "python -c \"open('bar', 'wb').write(b'bar\\n')\"", |
| 137 | ], |
| 138 | outs=["foo", "bar"], |
| 139 | no_commit=True, |
| 140 | ) |
| 141 | |
| 142 | cache = tmp_dir / ".dvc" / "cache" / "files" / "md5" |
| 143 | assert not list(cache.glob("*/*")) |
| 144 | |
| 145 | dvc.commit("foo") |
| 146 | assert list(cache.glob("*/*")) == [cache / "d3" / "b07384d113edec49eaa6238ad5ff00"] |
| 147 | |
| 148 | |
| 149 | def test_commit_granular_output_file(tmp_dir, dvc): |