From be1eedfb72a8a1d5c0cb0a325428a1e0ea81a8d1 Mon Sep 17 00:00:00 2001 From: Mykyta Holubakha Date: Thu, 8 Jun 2017 03:48:49 +0300 Subject: Initial progress on dispatch testing Fixed an error in the dispatcher --- tests/test_dispatch.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/test_dispatch.py 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) -- cgit v1.2.3-18-g5258