From: Zac Medico Date: Fri, 31 Dec 2010 06:56:34 +0000 (-0800) Subject: Merge dep_getrepo test from master. X-Git-Tag: v2.1.9.27~7 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d65faa0c79925d0d16127fb8db2c11575179ff3a;p=portage.git Merge dep_getrepo test from master. --- diff --git a/pym/portage/tests/dep/test_dep_getrepo.py b/pym/portage/tests/dep/test_dep_getrepo.py new file mode 100644 index 000000000..78ead8cee --- /dev/null +++ b/pym/portage/tests/dep/test_dep_getrepo.py @@ -0,0 +1,29 @@ +# Copyright 2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +from portage.tests import TestCase +from portage.dep import dep_getrepo + +class DepGetRepo(TestCase): + """ A simple testcase for isvalidatom + """ + + def testDepGetRepo(self): + + repo_char = "::" + repos = ( "a", "repo-name", "repo_name", "repo123", None ) + cpvs = ["sys-apps/portage"] + versions = ["2.1.1","2.1-r1", None] + uses = ["[use]", None] + for cpv in cpvs: + for version in versions: + for use in uses: + for repo in repos: + pkg = cpv + if version: + pkg = '=' + pkg + '-' + version + if repo is not None: + pkg = pkg + repo_char + repo + if use: + pkg = pkg + use + self.assertEqual( dep_getrepo( pkg ), repo )