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

Function test_remove_files_when_checkout

tests/func/test_checkout.py:118–133  ·  view source on GitHub ↗
(tmp_dir, dvc, scm)

Source from the content-addressed store, hash-verified

116
117
118def test_remove_files_when_checkout(tmp_dir, dvc, scm):
119 # add the file into a separate branch
120 scm.checkout("branch", True)
121 ret = main(["checkout", "--force"])
122 assert ret == 0
123 tmp_dir.dvc_gen("file_in_a_branch", "random text", commit="add file")
124
125 # Checkout back in master
126 scm.checkout("master")
127 assert os.path.exists("file_in_a_branch")
128
129 # Make sure `dvc checkout` removes the file
130 # self.dvc.checkout()
131 ret = main(["checkout", "--force"])
132 assert ret == 0
133 assert not os.path.exists("file_in_a_branch")
134
135
136class TestCheckoutCleanWorkingDir:

Callers

nothing calls this directly

Calls 4

mainFunction · 0.90
dvc_genMethod · 0.80
checkoutMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected