diff options
author | Alec Warner <antarus@gentoo.org> | 2007-01-11 19:06:52 +0000 |
---|---|---|
committer | Alec Warner <antarus@gentoo.org> | 2007-01-11 19:06:52 +0000 |
commit | 98a8516eff55814b51891e25879b6f2884895fbc (patch) | |
tree | ed75e973221fa39a94f555d104d5b8721a33f90b | |
parent | d5535498aa8a08d44b6195a6482edd5deb2fa8b3 (diff) | |
download | portage-98a8516eff55814b51891e25879b6f2884895fbc.tar.gz portage-98a8516eff55814b51891e25879b6f2884895fbc.tar.bz2 portage-98a8516eff55814b51891e25879b6f2884895fbc.zip |
Commit unit tests, hey look THEY ARE BROKEN
svn path=/main/trunk/; revision=5557
-rw-r--r-- | tests/portage_dep/test_isvalidatom.py | 37 | ||||
-rw-r--r-- | tests/portage_util/test_grabdict.py | 12 |
2 files changed, 49 insertions, 0 deletions
diff --git a/tests/portage_dep/test_isvalidatom.py b/tests/portage_dep/test_isvalidatom.py new file mode 100644 index 000000000..bdf4359f8 --- /dev/null +++ b/tests/portage_dep/test_isvalidatom.py @@ -0,0 +1,37 @@ +# test_isvalidatom.py -- Portage Unit Testing Functionality +# Copyright 2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: test_atoms.py 5525 2007-01-10 13:35:03Z antarus $ + +from unittest import TestCase +from portage_dep import isvalidatom + +class IsValidAtom(TestCase): + """ A simple testcase for isvalidatom + """ + + def testIsValidAtom(self): + + tests = [ ( "sys-apps/portage", True ), + ( "=sys-apps/portage-2.1", True ), + ( "=sys-apps/portage-2.1*", True ), + ( ">=sys-apps/portage-2.1", True ), + ( "<=sys-apps/portage-2.1", True ), + ( ">sys-apps/portage-2.1", True ), + ( "<sys-apps/portage-2.1", True ), + ( "~sys-apps/portage-2.1", True ), + ( ">~cate-gory/foo-1.0", False ), + ( ">~category/foo-1.0", False ), + ( "<~category/foo-1.0", False ), + ( "###cat/foo-1.0", False ), + ( "~sys-apps/portage", False ), + ( "portage", False ) ] + + for test in tests: + if test[1]: + atom_type = "valid" + else: + atom_type = "invalid" + + self.failIf( isvalidatom( test[0] ) != test[1], + msg="%s should be a(n) %s atom!" % (test[0], atom_type ) ) diff --git a/tests/portage_util/test_grabdict.py b/tests/portage_util/test_grabdict.py new file mode 100644 index 000000000..74b28ca27 --- /dev/null +++ b/tests/portage_util/test_grabdict.py @@ -0,0 +1,12 @@ +# test_grabDict.py -- Portage Unit Testing Functionality +# Copyright 2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: test_vercmp.py 5213 2006-12-08 00:12:41Z antarus $ + +from unittest import TestCase, TestLoader +from portage_util import grabdict + +class GrabDictTestCase(TestCase): + + def testGrabDictPass(self): + pass |