summaryrefslogtreecommitdiffstats
path: root/tests/portage_util
diff options
context:
space:
mode:
authorAlec Warner <antarus@gentoo.org>2007-01-27 18:16:08 +0000
committerAlec Warner <antarus@gentoo.org>2007-01-27 18:16:08 +0000
commit6ac1f119472d2e41650f4cf7a9bdb17a3afda42c (patch)
treed993452f7ea513226b6fa4f6fd1ce130796a2914 /tests/portage_util
parent8a4a1ddb2255979e94ba5dd0148c4bbfd4920e57 (diff)
downloadportage-6ac1f119472d2e41650f4cf7a9bdb17a3afda42c.tar.gz
portage-6ac1f119472d2e41650f4cf7a9bdb17a3afda42c.tar.bz2
portage-6ac1f119472d2e41650f4cf7a9bdb17a3afda42c.zip
Move tests into new directory structure
svn path=/main/trunk/; revision=5794
Diffstat (limited to 'tests/portage_util')
-rw-r--r--tests/portage_util/__init__.py5
-rw-r--r--tests/portage_util/test_grabdict.py12
-rw-r--r--tests/portage_util/test_normalizedPath.py15
-rw-r--r--tests/portage_util/test_stackDictList.py18
-rw-r--r--tests/portage_util/test_stackDicts.py37
-rw-r--r--tests/portage_util/test_stackLists.py20
-rw-r--r--tests/portage_util/test_uniqueArray.py26
-rw-r--r--tests/portage_util/test_varExpand.py60
8 files changed, 0 insertions, 193 deletions
diff --git a/tests/portage_util/__init__.py b/tests/portage_util/__init__.py
deleted file mode 100644
index 9a66903d1..000000000
--- a/tests/portage_util/__init__.py
+++ /dev/null
@@ -1,5 +0,0 @@
-# tests/portage.util/__init__.py -- Portage Unit Test functionality
-# Copyright 2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
diff --git a/tests/portage_util/test_grabdict.py b/tests/portage_util/test_grabdict.py
deleted file mode 100644
index 9f7b58921..000000000
--- a/tests/portage_util/test_grabdict.py
+++ /dev/null
@@ -1,12 +0,0 @@
-# test_grabDict.py -- Portage Unit Testing Functionality
-# Copyright 2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-from unittest import TestCase, TestLoader
-from portage.util import grabdict
-
-class GrabDictTestCase(TestCase):
-
- def testGrabDictPass(self):
- pass
diff --git a/tests/portage_util/test_normalizedPath.py b/tests/portage_util/test_normalizedPath.py
deleted file mode 100644
index bd575d266..000000000
--- a/tests/portage_util/test_normalizedPath.py
+++ /dev/null
@@ -1,15 +0,0 @@
-# test_normalizePath.py -- Portage Unit Testing Functionality
-# Copyright 2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-from unittest import TestCase
-
-class NormalizePathTestCase(TestCase):
-
- def testNormalizePath(self):
-
- from portage.util import normalize_path
- path = "///foo/bar/baz"
- good = "/foo/bar/baz"
- self.assertEqual(normalize_path(path), good)
diff --git a/tests/portage_util/test_stackDictList.py b/tests/portage_util/test_stackDictList.py
deleted file mode 100644
index 9e7a38ba1..000000000
--- a/tests/portage_util/test_stackDictList.py
+++ /dev/null
@@ -1,18 +0,0 @@
-# test_stackDictList.py -- Portage Unit Testing Functionality
-# Copyright 2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-from unittest import TestCase
-
-class StackDictListTestCase(TestCase):
-
- def testStackDictList(self):
- from portage.util import stack_dictlist
-
- tests = [ ({'a':'b'},{'x':'y'},False,{'a':['b'],'x':['y']}) ]
- tests.append(( {'KEYWORDS':['alpha','x86']},{'KEYWORDS':['-*']},True,{} ))
- tests.append(( {'KEYWORDS':['alpha','x86']},{'KEYWORDS':['-x86']},True,{'KEYWORDS':['alpha']} ))
- for test in tests:
- self.assertEqual(
- stack_dictlist([test[0],test[1]],incremental=test[2]), test[3] )
diff --git a/tests/portage_util/test_stackDicts.py b/tests/portage_util/test_stackDicts.py
deleted file mode 100644
index 9d9637440..000000000
--- a/tests/portage_util/test_stackDicts.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# test_stackDicts.py -- Portage Unit Testing Functionality
-# Copyright 2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-from unittest import TestCase
-from portage.util import stack_dicts
-
-
-class StackDictsTestCase(TestCase):
-
- def testStackDictsPass(self):
-
- tests = [ ( [ { "a":"b" }, { "b":"c" } ], { "a":"b", "b":"c" },
- False, [], False ),
- ( [ { "a":"b" }, { "a":"c" } ], { "a":"b c" },
- True, [], False ),
- ( [ { "a":"b" }, { "a":"c" } ], { "a":"b c" },
- False, ["a"], False ),
- ( [ { "a":"b" }, None ], { "a":"b" },
- False, [], True ),
- ( [ None ], None, False, [], False ),
- ( [ None, {}], {}, False, [], True ) ]
-
-
- for test in tests:
- result = stack_dicts( test[0], test[2], test[3], test[4] )
- self.assertEqual( result, test[1] )
-
- def testStackDictsFail(self):
-
- tests = [ ( [ None, {} ], None, False, [], True ),
- ( [ { "a":"b"}, {"a":"c" } ], { "a":"b c" },
- False, [], False ) ]
- for test in tests:
- result = stack_dicts( test[0], test[2], test[3], test[4] )
- self.assertNotEqual( result , test[1] )
diff --git a/tests/portage_util/test_stackLists.py b/tests/portage_util/test_stackLists.py
deleted file mode 100644
index 3fc028323..000000000
--- a/tests/portage_util/test_stackLists.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# test_stackLists.py -- Portage Unit Testing Functionality
-# Copyright 2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-from unittest import TestCase
-from portage.util import stack_lists
-
-class StackListsTestCase(TestCase):
-
- def testStackLists(self):
-
- tests = [ ( [ ['a','b','c'], ['d','e','f'] ], ['a','c','b','e','d','f'], False ),
- ( [ ['a','x'], ['b','x'] ], ['a','x','b'], False ),
- ( [ ['a','b','c'], ['-*'] ], [], True ),
- ( [ ['a'], ['-a'] ], [], True ) ]
-
- for test in tests:
- result = stack_lists( test[0], test[2] )
- self.assertEqual( result , test[1] )
diff --git a/tests/portage_util/test_uniqueArray.py b/tests/portage_util/test_uniqueArray.py
deleted file mode 100644
index 62a315321..000000000
--- a/tests/portage_util/test_uniqueArray.py
+++ /dev/null
@@ -1,26 +0,0 @@
-# test_uniqueArray.py -- Portage Unit Testing Functionality
-# Copyright 2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-from unittest import TestCase
-from portage.util import unique_array
-
-class UniqueArrayTestCase(TestCase):
-
- 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) )
diff --git a/tests/portage_util/test_varExpand.py b/tests/portage_util/test_varExpand.py
deleted file mode 100644
index 47dc7de2c..000000000
--- a/tests/portage_util/test_varExpand.py
+++ /dev/null
@@ -1,60 +0,0 @@
-# test_varExpand.py -- Portage Unit Testing Functionality
-# Copyright 2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-from unittest import TestCase, TestLoader
-from portage.util import varexpand
-
-class VarExpandTestCase(TestCase):
-
- def testVarExpandPass(self):
-
- varDict = { "a":"5", "b":"7", "c":"-5" }
- for key in varDict.keys():
- result = varexpand( "$%s" % key, varDict )
-
- self.failIf( result != varDict[key],
- msg="Got %s != %s, from varexpand( %s, %s )" % \
- ( result, varDict[key], "$%s" % key, varDict ) )
- result = varexpand( "${%s}" % key, varDict )
- self.failIf( result != varDict[key],
- msg="Got %s != %s, from varexpand( %s, %s )" % \
- ( result, varDict[key], "${%s}" % key, varDict ) )
-
- def testVarExpandDoubleQuotes(self):
-
- varDict = { "a":"5" }
- tests = [ ("\"${a}\"", "5") ]
- for test in tests:
- result = varexpand( test[0], varDict )
- self.failIf( result != test[1],
- msg="Got %s != %s from varexpand( %s, %s )" \
- % ( result, test[1], test[0], varDict ) )
-
- def testVarExpandSingleQuotes(self):
-
- varDict = { "a":"5" }
- tests = [ ("\'${a}\'", "${a}") ]
- for test in tests:
- result = varexpand( test[0], varDict )
- self.failIf( result != test[1],
- msg="Got %s != %s from varexpand( %s, %s )" \
- % ( result, test[1], test[0], varDict ) )
-
- def testVarExpandFail(self):
-
- varDict = { "a":"5", "b":"7", "c":"15" }
-
- testVars = [ "fail" ]
-
- for var in testVars:
- result = varexpand( "$%s" % var, varDict )
- self.failIf( len(result),
- msg="Got %s == %s, from varexpand( %s, %s )" \
- % ( result, var, "$%s" % var, varDict ) )
-
- result = varexpand( "${%s}" % var, varDict )
- self.failIf( len(result),
- msg="Got %s == %s, from varexpand( %s, %s )" \
- % ( result, var, "${%s}" % var, varDict ) )