diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-12-30 22:56:34 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-12-30 22:56:34 -0800 |
commit | d65faa0c79925d0d16127fb8db2c11575179ff3a (patch) | |
tree | 0c9d27cfc91529a6172cca2ba7a2346c819dcac6 /pym | |
parent | 109ebd70df1b1c654f95f7456ea6f2b1243d1b7d (diff) | |
download | portage-d65faa0c79925d0d16127fb8db2c11575179ff3a.tar.gz portage-d65faa0c79925d0d16127fb8db2c11575179ff3a.tar.bz2 portage-d65faa0c79925d0d16127fb8db2c11575179ff3a.zip |
Merge dep_getrepo test from master.
Diffstat (limited to 'pym')
-rw-r--r-- | pym/portage/tests/dep/test_dep_getrepo.py | 29 |
1 files changed, 29 insertions, 0 deletions
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 ) |