summaryrefslogtreecommitdiffstats
path: root/tests/portage_util/test_varExpand.py
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/test_varExpand.py
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/test_varExpand.py')
-rw-r--r--tests/portage_util/test_varExpand.py60
1 files changed, 0 insertions, 60 deletions
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 ) )