aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMykyta Holubakha <hilobakho@gmail.com>2017-06-02 02:28:59 +0300
committerMykyta Holubakha <hilobakho@gmail.com>2017-06-02 02:28:59 +0300
commitaa671b396d234e89f049c9dbe742398552c36e1d (patch)
treef16bed5b9b09688bf71e9ed9d364b4e52df21fe8
parentFinish repo initialization (diff)
downloadpomu-aa671b396d234e89f049c9dbe742398552c36e1d.tar.gz
pomu-aa671b396d234e89f049c9dbe742398552c36e1d.tar.bz2
pomu-aa671b396d234e89f049c9dbe742398552c36e1d.zip
Added unit testing support
-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')