summaryrefslogtreecommitdiffstats
path: root/tests/portage_util/test_uniqueArray.py
diff options
context:
space:
mode:
authorAlec Warner <antarus@gentoo.org>2007-01-11 08:45:13 +0000
committerAlec Warner <antarus@gentoo.org>2007-01-11 08:45:13 +0000
commit848f6e5d29a84970c2356fb9af45326288f73ed6 (patch)
tree5c1e45a16c3df87e82dc52a4f35f2c2e2cf6151a /tests/portage_util/test_uniqueArray.py
parentb1bee095d4276b071ebb34a0c2ed9ee1db4570d9 (diff)
downloadportage-848f6e5d29a84970c2356fb9af45326288f73ed6.tar.gz
portage-848f6e5d29a84970c2356fb9af45326288f73ed6.tar.bz2
portage-848f6e5d29a84970c2356fb9af45326288f73ed6.zip
More portage_util tests
svn path=/main/trunk/; revision=5547
Diffstat (limited to 'tests/portage_util/test_uniqueArray.py')
-rw-r--r--tests/portage_util/test_uniqueArray.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/portage_util/test_uniqueArray.py b/tests/portage_util/test_uniqueArray.py
index 654eb4b1c..bc0b750b9 100644
--- a/tests/portage_util/test_uniqueArray.py
+++ b/tests/portage_util/test_uniqueArray.py
@@ -4,8 +4,23 @@
# $Id: test_vercmp.py 5213 2006-12-08 00:12:41Z antarus $
from unittest import TestCase
+from portage_util import unique_array
class UniqueArrayTestCase(TestCase):
- def testUniqueArray(self):
- pass
+ def testUniqueArrayPass(self):
+ """
+ test portage_util.uniqueArray()
+ """
+
+ import os
+
+ tests = [ ( ["a","a","a",os,os,[],[],[]], ['a',os,[]] ),
+ ( [1,1,1,2,3,4,4] , [1,2,3,4]) ]
+
+ for test in tests:
+ result = unique_array( test[0] )
+ for item in test[1]:
+ number = result.count(item)
+ self.failIf( number is not 1, msg="%s contains %s of %s, \
+ should be only 1" % (result, number, item) )