aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMykyta Holubakha <hilobakho@gmail.com>2017-06-08 03:48:49 +0300
committerMykyta Holubakha <hilobakho@gmail.com>2017-06-08 03:48:49 +0300
commitbe1eedfb72a8a1d5c0cb0a325428a1e0ea81a8d1 (patch)
tree49c67310e34cd5cb2bbea69d707869d6ac0ac41f
parentHook up sources, repo and dispatcher (diff)
downloadpomu-be1eedfb72a8a1d5c0cb0a325428a1e0ea81a8d1.tar.gz
pomu-be1eedfb72a8a1d5c0cb0a325428a1e0ea81a8d1.tar.bz2
pomu-be1eedfb72a8a1d5c0cb0a325428a1e0ea81a8d1.zip
Initial progress on dispatch testing
Fixed an error in the dispatcher
-rw-r--r--tests/test_dispatch.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/test_dispatch.py b/tests/test_dispatch.py
new file mode 100644
index 0000000..c851c0a
--- /dev/null
+++ b/tests/test_dispatch.py
@@ -0,0 +1,28 @@
+import unittest
+from os import path
+from tempfile import mkdtemp
+
+import pomu.source
+from pomu.package import Package
+from pomu.repo.repo import pomu_status, portage_repos, portage_active_repo
+from pomu.util.result import Result
+
+@dispatcher.source
+class DummySource():
+ def __init__(self, _path):
+ self.path = _path
+
+ @dispatcher.handler
+ def parse(self, uri):
+ return Result.Ok(uri)
+
+ def fetch_package(self, uri):
+ return Package('test', self.path)
+
+class InstallTests(unittests.TestCase):
+
+ def setUp(self):
+ source_path = mkdtemp()
+ with path.join(source_path, 'test.ebuild') as f:
+ f.write('# Copytight 1999-2017\nAll Rights Reserved\nEAPI="0"\n')
+ self.source = DummySource(source_path)