MCPcopy
hub / github.com/treeverse/dvc / test_commit_updates_to_cloud_versioning_dir

Function test_commit_updates_to_cloud_versioning_dir

tests/func/test_commit.py:249–306  ·  view source on GitHub ↗
(tmp_dir, dvc)

Source from the content-addressed store, hash-verified

247
248
249def test_commit_updates_to_cloud_versioning_dir(tmp_dir, dvc):
250 data_dvc = tmp_dir / "data.dvc"
251 data_dvc.dump(
252 {
253 "outs": [
254 {
255 "path": "data",
256 "hash": "md5",
257 "files": [
258 {
259 "size": 3,
260 "version_id": "WYRG4BglP7pD.gEoJP6a4AqOhl.FRA.h",
261 "etag": "acbd18db4cc2f85cedef654fccc4a4d8",
262 "md5": "acbd18db4cc2f85cedef654fccc4a4d8",
263 "relpath": "bar",
264 },
265 {
266 "size": 3,
267 "version_id": "0vL53tFVY5vVAoJ4HG2jCS1mEcohDPE0",
268 "etag": "acbd18db4cc2f85cedef654fccc4a4d8",
269 "md5": "acbd18db4cc2f85cedef654fccc4a4d8",
270 "relpath": "foo",
271 },
272 ],
273 }
274 ]
275 }
276 )
277
278 data = tmp_dir / "data"
279 data.mkdir()
280 (data / "foo").write_text("foo")
281 (data / "bar").write_text("bar2")
282
283 dvc.commit("data", force=True)
284
285 assert (tmp_dir / "data.dvc").parse() == {
286 "outs": [
287 {
288 "path": "data",
289 "hash": "md5",
290 "files": [
291 {
292 "size": 4,
293 "md5": "224e2539f52203eb33728acd228b4432",
294 "relpath": "bar",
295 },
296 {
297 "size": 3,
298 "version_id": "0vL53tFVY5vVAoJ4HG2jCS1mEcohDPE0",
299 "etag": "acbd18db4cc2f85cedef654fccc4a4d8",
300 "md5": "acbd18db4cc2f85cedef654fccc4a4d8",
301 "relpath": "foo",
302 },
303 ],
304 }
305 ]
306 }

Callers

nothing calls this directly

Calls 5

mkdirMethod · 0.80
write_textMethod · 0.80
parseMethod · 0.80
dumpMethod · 0.45
commitMethod · 0.45

Tested by

no test coverage detected