diff --git a/tests/test_project/test_cli.py b/tests/test_project/test_cli.py index ae66f98..9ed286e 100644 --- a/tests/test_project/test_cli.py +++ b/tests/test_project/test_cli.py @@ -22,3 +22,9 @@ class ProjectRunCLITestCase(BaseTestCase): self.assertIn(str(self.project.root), env["PATH"]) for path in self.project.get_extra_path(): self.assertIn(str(path), env["PATH"]) + + def test_sets_working_dir(self): + with self.in_example_dir(): + result = self.run_cli(["project", "run", "pwd"], catch_exceptions=False) + self.assertEqual(result.exit_code, 0) + self.assertEqual(result.stdout.strip(), str(self.project.root)) diff --git a/tests/test_worker/test_server.py b/tests/test_worker/test_server.py index a86e99a..bf9c7fc 100644 --- a/tests/test_worker/test_server.py +++ b/tests/test_worker/test_server.py @@ -55,6 +55,14 @@ class ProcessWorkerTestCase(BaseWorkerTestCase): for path in self.project.get_extra_path(): self.assertIn(str(path), path_dirs) + def test_sets_working_dir(self): + response = send_to_server( + PayloadType.PROCESS, + {"path": str(self.project.root), "process": str(self.process.name)}, + ) + cwd = psutil.Process(response["pid"]).cwd() + self.assertEqual(cwd, str(self.project.root)) + def test_process_restart(self): response = send_to_server( PayloadType.PROCESS,