diff options
author | Mykyta Holubakha <hilobakho@gmail.com> | 2017-06-08 03:48:49 +0300 |
---|---|---|
committer | Mykyta Holubakha <hilobakho@gmail.com> | 2017-06-08 03:48:49 +0300 |
commit | be1eedfb72a8a1d5c0cb0a325428a1e0ea81a8d1 (patch) | |
tree | 49c67310e34cd5cb2bbea69d707869d6ac0ac41f | |
parent | Hook up sources, repo and dispatcher (diff) | |
download | pomu-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.py | 28 |
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) |