From c63c709c797c5387591cc8a0a79c94b4347ef693 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 18 Dec 2018 15:34:57 +0000 Subject: [PATCH] Add project names --- catfish/project/__init__.py | 4 ++++ tests/test_project/test_project.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/catfish/project/__init__.py b/catfish/project/__init__.py index 20f244e..57038be 100644 --- a/catfish/project/__init__.py +++ b/catfish/project/__init__.py @@ -27,3 +27,7 @@ class Project: def exists(self): return self.root.exists() and self.root.is_dir() + + @property + def name(self): + return self.root.name diff --git a/tests/test_project/test_project.py b/tests/test_project/test_project.py index e053f2b..d454776 100644 --- a/tests/test_project/test_project.py +++ b/tests/test_project/test_project.py @@ -19,3 +19,6 @@ class ProjectTestCase(BaseTestCase): process = self.project.processes[0] self.assertEqual(process.name, "web") self.assertEqual(process.command, "python -m http.server $PORT") + + def test_name(self): + self.assertEqual(self.project.name, 'example')