archive
/
catfish
Archived
1
Fork 0

Add tests for commands working directories

This commit is contained in:
Jake Howard 2018-12-21 14:02:27 +00:00
parent 3646407227
commit 2c9af76b88
Signed by: jake
GPG Key ID: 57AFB45680EDD477
2 changed files with 14 additions and 0 deletions

View File

@ -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))

View File

@ -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,