[Sugar-devel] [PATCH sugar-toolkit-gtk3 4/4] Add test for dev command

Daniel Narvaez dwnarvaez at gmail.com
Thu Dec 6 17:26:49 EST 2012


From: Daniel Narvaez <dwnarvaez at gmail.com>

---
 tests/test_bundlebuilder.py |   26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/tests/test_bundlebuilder.py b/tests/test_bundlebuilder.py
index d829281..46a02a1 100644
--- a/tests/test_bundlebuilder.py
+++ b/tests/test_bundlebuilder.py
@@ -124,6 +124,23 @@ class TestGit(unittest.TestCase):
 
         os.chdir(cwd)
 
+    def _test_dev(self, source_path, build_path):
+        activities_path = tempfile.mkdtemp()
+
+        cwd = os.getcwd()
+        os.chdir(build_path)
+
+        os.environ["SUGAR_ACTIVITIES_PATH"] = activities_path
+
+        setup_path = os.path.join(source_path, "setup.py")
+        subprocess.call([setup_path, "dev"])
+
+        activity_py_path = os.path.join(activities_path, "Sample.activity",
+                                        "activity.py")
+        self.assertTrue(os.path.exists(activity_py_path))
+
+        os.chdir(cwd)
+ 
     def _test_genpot(self, source_path, build_path):
         cwd = os.getcwd()
         os.chdir(build_path)
@@ -208,6 +225,15 @@ class TestGit(unittest.TestCase):
         build_path = tempfile.mkdtemp()
         self._test_build(repo_path, build_path)
 
+    def test_dev_in_source(self):
+        repo_path = self._create_repo()
+        self._test_genpot(repo_path, repo_path)
+
+    def test_dev_out_of_source(self):
+        repo_path = self._create_repo()
+        build_path = tempfile.mkdtemp()
+        self._test_dev(repo_path, build_path)
+
     def test_genpot_in_source(self):
         repo_path = self._create_repo()
         self._test_genpot(repo_path, repo_path)
-- 
1.7.10.4



More information about the Sugar-devel mailing list