aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/__init__.py0
-rw-r--r--tests/test_init.py25
2 files changed, 25 insertions, 0 deletions
diff --git a/tests/__init__.py b/tests/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/__init__.py
diff --git a/tests/test_init.py b/tests/test_init.py
new file mode 100644
index 0000000..14c288a
--- /dev/null
+++ b/tests/test_init.py
@@ -0,0 +1,25 @@
+from os import makedirs
+from shutil import rmtree
+import unittest
+
+from pomu.repo.init import init_plain_repo, init_pomu
+from pomu.repo.repo import pomu_status
+from pomu.util.result import Result
+
+REPO_PATH = 'test_repo'
+
+class RepoInitialization(unittest.TestCase):
+
+ def setUp(self):
+ self.REPO_PATH = REPO_PATH
+
+ def tearDown(self):
+ rmtree(self.REPO_PATH)
+
+ def testPlainInitializationAndStatus(self):
+ init_plain_repo(True, self.REPO_PATH).expect()
+ self.assertEqual(pomu_status(self.REPO_PATH), True)
+
+ def testNonGitInitialization(self):
+ makedirs(self.REPO_PATH)
+ self.assertEqual(init_pomu(self.REPO_PATH).err(), 'target repository should be a git repo')