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

Function test_daemon

tests/unit/test_daemon.py:7–21  ·  view source on GitHub ↗
(mocker)

Source from the content-addressed store, hash-verified

5
6
7def test_daemon(mocker):
8 mock = mocker.patch("dvc.daemon._spawn")
9 daemon.daemon(["updater"])
10
11 mock.assert_called()
12 args = mock.call_args[0]
13 env = args[2]
14 assert "PYTHONPATH" in env
15
16 file_path = os.path.abspath(inspect.stack()[0][1])
17 file_dir = os.path.dirname(file_path)
18 test_dir = os.path.dirname(file_dir)
19 dvc_dir = os.path.dirname(test_dir)
20 assert env["PYTHONPATH"] == dvc_dir
21 assert env[daemon.DVC_DAEMON] == "1"
22
23
24def test_no_recursive_spawn(mocker):

Callers

nothing calls this directly

Calls 1

abspathMethod · 0.80

Tested by

no test coverage detected