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

Function test_checkout_executable

tests/func/test_checkout.py:756–773  ·  view source on GitHub ↗
(tmp_dir, dvc)

Source from the content-addressed store, hash-verified

754
755
756def test_checkout_executable(tmp_dir, dvc):
757 tmp_dir.dvc_gen("foo", "foo")
758
759 contents = (tmp_dir / "foo.dvc").parse()
760 contents["outs"][0]["isexec"] = True
761 (tmp_dir / "foo.dvc").dump(contents)
762
763 assert dvc.checkout("foo") == empty_checkout | {
764 "modified": ["foo"],
765 "stats": empty_stats | {"modified": 1},
766 }
767
768 isexec = os.stat("foo").st_mode & stat.S_IEXEC
769 if os.name == "nt":
770 # NOTE: you can't set exec bits on Windows
771 assert not isexec
772 else:
773 assert isexec
774
775
776def test_checkout_partial(tmp_dir, dvc):

Callers

nothing calls this directly

Calls 4

dvc_genMethod · 0.80
parseMethod · 0.80
dumpMethod · 0.45
checkoutMethod · 0.45

Tested by

no test coverage detected