From 6ac1f119472d2e41650f4cf7a9bdb17a3afda42c Mon Sep 17 00:00:00 2001 From: Alec Warner Date: Sat, 27 Jan 2007 18:16:08 +0000 Subject: Move tests into new directory structure svn path=/main/trunk/; revision=5794 --- tests/portage_util/test_varExpand.py | 60 ------------------------------------ 1 file changed, 60 deletions(-) delete mode 100644 tests/portage_util/test_varExpand.py (limited to 'tests/portage_util/test_varExpand.py') 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 ) ) -- cgit v1.2.3-1-g7c22