summaryrefslogtreecommitdiffstats
path: root/tests/__init__.py
diff options
context:
space:
mode:
authorAlec Warner <antarus@gentoo.org>2007-02-01 19:00:56 +0000
committerAlec Warner <antarus@gentoo.org>2007-02-01 19:00:56 +0000
commite56e1c1caaa08325fdf398ac385bb804aa46c269 (patch)
tree5f77a393c9343edf65bbf94469db694e04fdcb2c /tests/__init__.py
parentc78d5fc325f9ed1cbac049e2b0bb52948a084e09 (diff)
downloadportage-e56e1c1caaa08325fdf398ac385bb804aa46c269.tar.gz
portage-e56e1c1caaa08325fdf398ac385bb804aa46c269.tar.bz2
portage-e56e1c1caaa08325fdf398ac385bb804aa46c269.zip
apparently I'm retarded and missed some of the tests..
svn path=/main/trunk/; revision=5864
Diffstat (limited to 'tests/__init__.py')
-rw-r--r--tests/__init__.py54
1 files changed, 0 insertions, 54 deletions
diff --git a/tests/__init__.py b/tests/__init__.py
deleted file mode 100644
index 59152e057..000000000
--- a/tests/__init__.py
+++ /dev/null
@@ -1,54 +0,0 @@
-# tests/__init__.py -- Portage Unit Test functionality
-# Copyright 2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-import os, unittest
-
-def main():
-
- testDirs = ["portage", "portage/util","portage/versions", "portage/dep"]
-
- suite = unittest.TestSuite()
-
- basedir = os.path.dirname(__file__)
- for mydir in testDirs:
- suite.addTests(getTests(os.path.join(basedir, mydir), basedir) )
-
- return unittest.TextTestRunner(verbosity=2).run(suite)
-
-def my_import(name):
- mod = __import__(name)
- components = name.split('.')
- for comp in components[1:]:
- mod = getattr(mod, comp)
- return mod
-
-def getTests( path, base_path ):
- """
-
- path is the path to a given subdir ( 'portage/' for example)
- This does a simple filter on files in that dir to give us modules
- to import
-
- """
- import os
- files = os.listdir( path )
- files = [ f[:-3] for f in files if f.startswith("test_") and f.endswith(".py") ]
- parent_path = path[len(base_path)+1:]
- parent_module = ".".join(("tests", parent_path))
- result = []
- for mymodule in files:
- try:
- # Make the trailing / a . for module importing
- modname = ".".join((parent_module, mymodule))
- mod = my_import(modname)
- result.append( unittest.TestLoader().loadTestsFromModule(mod) )
- except ImportError:
- raise
- return result
-
-test_cpvs = ['sys-apps/portage','virtual/portage']
-test_versions = ['1.0', '1.0-r1','2.3_p4','1.0_alpha57']
-test_slots = [ None, '1','gentoo-sources-2.6.17','spankywashere']
-test_usedeps = ['foo','-bar', ['foo','bar'],['foo','-bar'] ]