diff options
Diffstat (limited to 'pym/gentoolkit/test')
-rw-r--r-- | pym/gentoolkit/test/eclean/creator.py | 10 | ||||
-rw-r--r-- | pym/gentoolkit/test/eclean/distsupport.py | 11 | ||||
-rwxr-xr-x | pym/gentoolkit/test/eclean/test_clean.py | 241 | ||||
-rwxr-xr-x | pym/gentoolkit/test/eclean/test_search.py | 6 | ||||
-rw-r--r-- | pym/gentoolkit/test/test_atom.py | 2 | ||||
-rw-r--r-- | pym/gentoolkit/test/test_cpv.py | 2 | ||||
-rw-r--r-- | pym/gentoolkit/test/test_helpers.py | 59 | ||||
-rw-r--r-- | pym/gentoolkit/test/test_keyword.py | 3 |
8 files changed, 161 insertions, 173 deletions
diff --git a/pym/gentoolkit/test/eclean/creator.py b/pym/gentoolkit/test/eclean/creator.py index 63bffd1..de50426 100644 --- a/pym/gentoolkit/test/eclean/creator.py +++ b/pym/gentoolkit/test/eclean/creator.py @@ -17,7 +17,7 @@ import shutil import random import gentoolkit.pprinter as pp -from portage import _encodings, _unicode_decode, _unicode_encode +from portage import _encodings, _unicode_encode __version__= "0.0.1" __author__ = "Brian Dolbec" @@ -97,7 +97,7 @@ def make_symlinks(path, links, targets): and need to be in the same index order as links """ for i in range(len(links)): - os.symlink(os.path.join(path,target[i]), + os.symlink(os.path.join(path,targets[i]), os.path.join(path, links[i])) @@ -236,11 +236,9 @@ class TestDirCreation(object): make_dist(self.options['target_path'], self.distfile_list, self.dist_clean) # add some symlinks to it path = os.path.join(self.options['target_path'], 'distfiles') - make_symlinks(path, distfile_symlink, - dist_clean['symlink-test-1.2.3.tar.bz2']) + make_symlinks(path, self.distfile_symlink, + self.dist_clean['symlink-test-1.2.3.tar.bz2']) # create the packages dir and populate it path = os.path.join(self.options['target_path'], 'packages') make_pkgs(path, self.package_dict, self.pkg_clean) self.targets_init = True - - #def get_ diff --git a/pym/gentoolkit/test/eclean/distsupport.py b/pym/gentoolkit/test/eclean/distsupport.py index e9ab8a1..7b444d2 100644 --- a/pym/gentoolkit/test/eclean/distsupport.py +++ b/pym/gentoolkit/test/eclean/distsupport.py @@ -10,8 +10,7 @@ from __future__ import print_function import re import os -import unittest -from tempfile import NamedTemporaryFile, mkdtemp +from tempfile import mkdtemp import subprocess import portage @@ -156,9 +155,6 @@ PROPS = { 'dev-libs/libisofs-0.6.26': { "SRC_URI": 'http://files.libburnia-project.org/releases/libisofs-0.6.26.tar.gz', "RESTRICT": ''}, - 'app-portage/portage-utils-0.3.1': { - "SRC_URI": 'mirror://gentoo/portage-utils-0.3.1.tar.bz2', - "RESTRICT": ''}, 'app-portage/gentoolkit-0.3.0_rc8-r1': { "SRC_URI": 'mirror://gentoo/gentoolkit-0.3.0_rc8.tar.gz http://dev.gentoo.org/~fuzzyray/distfiles/gentoolkit-0.3.0_rc8.tar.gz', "RESTRICT": ''}, @@ -171,9 +167,6 @@ PROPS = { 'app-portage/gentoolkit-0.2.4.5': { "SRC_URI": 'mirror://gentoo/gentoolkit-0.2.4.5.tar.gz http://dev.gentoo.org/~fuzzyray/distfiles/gentoolkit-0.2.4.5.tar.gz', "RESTRICT": ''}, - 'app-portage/portage-utils-0.2.1': { - "SRC_URI": 'mirror://gentoo/portage-utils-0.2.1.tar.bz2', - "RESTRICT": ''}, 'app-portage/gentoolkit-0.3.0_rc8': { "SRC_URI": 'mirror://gentoo/gentoolkit-0.3.0_rc8.tar.gz http://dev.gentoo.org/~fuzzyray/distfiles/gentoolkit-0.3.0_rc8.tar.gz', "RESTRICT": ''}, @@ -460,7 +453,7 @@ class TestDisfiles(object): dir = os.path.dirname(os.path.abspath(__file__)) file = os.path.join(dir,"testdistfiles.tar.gz") command = "tar -xpf %s -C %s" %(file, self.tmpdir) - retcode = subprocess.call(command, shell=True) + subprocess.call(command, shell=True) # create a symlink as part of the test files #print() self.target_symlink = "symlink-1.0.0.tar.gz" diff --git a/pym/gentoolkit/test/eclean/test_clean.py b/pym/gentoolkit/test/eclean/test_clean.py index 36b6281..0fc9469 100755 --- a/pym/gentoolkit/test/eclean/test_clean.py +++ b/pym/gentoolkit/test/eclean/test_clean.py @@ -12,137 +12,138 @@ __version__= "0.0.1" __author__ = "Brian Dolbec" __email__ = "brian.dolbec@gmail.com" -from getopt import gnu_getopt, GetoptError +# Whole unit commented out for being broken +# from getopt import gnu_getopt, GetoptError -import unittest -import os -import sys +# import unittest +# import os +# import sys -import gentoolkit.pprinter as pp +# import gentoolkit.pprinter as pp -from gentoolkit.eclean.clean import CleanUp +# from gentoolkit.eclean.clean import CleanUp -class Controllers(object): - """Contains controller methods for use in testing - the clean module methods""" +# class Controllers(object): +# """Contains controller methods for use in testing +# the clean module methods""" - def __init__(self): - self.gathered_data = [] - self.authorize = True - self.authorize_list = [] - self.authorize_index = 0 +# def __init__(self): +# self.gathered_data = [] +# self.authorize = True +# self.authorize_list = [] +# self.authorize_index = 0 - def authorize_all_controller(self, size, key, clean_list): - """data gatherering controller. +# def authorize_all_controller(self, size, key, clean_list): +# """data gatherering controller. - @rtype: Boolean - @returns: self.authorize which controls the cleaning method - """ - self.gathered_data.append([size, key, clean_list]) - return self.authorize +# @rtype: Boolean +# @returns: self.authorize which controls the cleaning method +# """ +# self.gathered_data.append([size, key, clean_list]) +# return self.authorize - def authorize_list_controller(self, size, key, clean_list): - """data gathering and controller which - authorizes acoring to a pre-determined list +# def authorize_list_controller(self, size, key, clean_list): +# """data gathering and controller which +# authorizes acoring to a pre-determined list - @rtype: Boolean - @return self.authorize_list[self.authorize_index]""" - self.gathered_data.append([size, key, clean_list]) - index = self.authorize_index - self.authorize_index =+ 1 - return self.authorize_list[index] +# @rtype: Boolean +# @return self.authorize_list[self.authorize_index]""" +# self.gathered_data.append([size, key, clean_list]) +# index = self.authorize_index +# self.authorize_index =+ 1 +# return self.authorize_list[index] -#class TestCleanUp(unittest.TestCase): -# """Test module for the various CleanUp class methods -# -# @param options: dict of module options -# @param testdata: dict. of path and test parameters -# as created by the TestDirCreation class""" -# -# def __init__(self, options, testdata): -# self.options = options -# self.tesdata = testdata -# -# -# def test_symlink_clean(): -# """Tests the symbolic link portion of the distfiles -# cleaning""" -# pass -# -# -# def test_dist_clean(): -# """Test the distfiles cleaning""" -# pass -# -# -# def test_pkg_clean(): -# """Test the packages cleaning""" -# pass -# -# -# def test_pretend_clean(): -# """Test the pretend_clean output""" -# controlller = Controllers().authorize_all_controller -# clean = CleanUp(controller) -# clean.pretend_clean(self.dist_clean) -# data = controller.gathered_data - - - -def useage(): - """output run options""" - print("Useage: test_clean [OPTONS] path=test-dir") - print(" where test-dir is the location to create and populate") - print("the testing distfiles and packages directories.") - print("All tests in this module test only the clean.py module functions") - print() - print("OPTIONS:") - print(" -a, --all run all tests") - print(" -c, --clean clean up any previous test dirs & files") - print(" -D, --distfiles run the distfiles cleaning test") - print(" -k, --keep-dirs keep the test directories and files after the test") - print(" -p, --pretend run the test in pretend mode only") - print(" -P, --packages run the packages cleaning test") - print(" -S, --symlinks run the symlinks test") - print(" --path the location to create the temporary distfiles") - print(" and packages directories that will be test cleaned") - print(" --version test module version") - print() - - -def parse_opts(): - """Parse the options dict - - @return options: dictionary of module options""" - try: - opts, args = getopt(sys.argv[1:], 'acDkpPS', ["version", - "help", "path=", "all", "distfiles", "packages", - "pretend", "symlinks", "keep-dirs", "clean"]) - #print opts - #print args - except GetoptError as e: - print(e.msg, file=sys.stderr) - usage() - sys.exit(1) - - - -def main(cmdline=False): - """parse options and run the tests""" - - if cmdline: - options = parse_opts() - - -if __name__ == "__main__": - """actually call main() if launched as a script""" - try: - main(True) - except KeyboardInterrupt: - print("Aborted.") - sys.exit(130) - sys.exit(0) +# class TestCleanUp(unittest.TestCase): +# """Test module for the various CleanUp class methods + +# @param options: dict of module options +# @param testdata: dict. of path and test parameters +# as created by the TestDirCreation class""" + +# def __init__(self, options, testdata): +# self.options = options +# self.tesdata = testdata + + +# def test_symlink_clean(): +# """Tests the symbolic link portion of the distfiles +# cleaning""" +# pass + + +# def test_dist_clean(): +# """Test the distfiles cleaning""" +# pass + + +# def test_pkg_clean(): +# """Test the packages cleaning""" +# pass + + +# def test_pretend_clean(): +# """Test the pretend_clean output""" +# controlller = Controllers().authorize_all_controller +# clean = CleanUp(controller) +# clean.pretend_clean(self.dist_clean) +# data = controller.gathered_data + + + +# def useage(): +# """output run options""" +# print("Useage: test_clean [OPTONS] path=test-dir") +# print(" where test-dir is the location to create and populate") +# print("the testing distfiles and packages directories.") +# print("All tests in this module test only the clean.py module functions") +# print() +# print("OPTIONS:") +# print(" -a, --all run all tests") +# print(" -c, --clean clean up any previous test dirs & files") +# print(" -D, --distfiles run the distfiles cleaning test") +# print(" -k, --keep-dirs keep the test directories and files after the test") +# print(" -p, --pretend run the test in pretend mode only") +# print(" -P, --packages run the packages cleaning test") +# print(" -S, --symlinks run the symlinks test") +# print(" --path the location to create the temporary distfiles") +# print(" and packages directories that will be test cleaned") +# print(" --version test module version") +# print() + + +# def parse_opts(): +# """Parse the options dict + +# @return options: dictionary of module options""" +# try: +# opts, args = getopt(sys.argv[1:], 'acDkpPS', ["version", +# "help", "path=", "all", "distfiles", "packages", +# "pretend", "symlinks", "keep-dirs", "clean"]) +# #print opts +# #print args +# except GetoptError as e: +# print(e.msg, file=sys.stderr) +# usage() +# sys.exit(1) + + + +# def main(cmdline=False): +# """parse options and run the tests""" + +# if cmdline: +# options = parse_opts() + + +# if __name__ == "__main__": +# """actually call main() if launched as a script""" +# try: +# main(True) +# except KeyboardInterrupt: +# print("Aborted.") +# sys.exit(130) +# sys.exit(0) diff --git a/pym/gentoolkit/test/eclean/test_search.py b/pym/gentoolkit/test/eclean/test_search.py index 7e27f9e..1720688 100755 --- a/pym/gentoolkit/test/eclean/test_search.py +++ b/pym/gentoolkit/test/eclean/test_search.py @@ -12,11 +12,13 @@ from __future__ import print_function -from tempfile import NamedTemporaryFile, mkdtemp import unittest import re +import os -from gentoolkit.test.eclean.distsupport import * +from gentoolkit.test.eclean.distsupport import ( + FILES, TestDisfiles, OutputSimulator, Dbapi, CPVS, CPVS2, CPVS3, PROPS, + PKGS, CLEAN_ME, get_props) import gentoolkit.eclean.search as search from gentoolkit.eclean.search import DistfilesSearch from gentoolkit.eclean.exclude import parseExcludeFile diff --git a/pym/gentoolkit/test/test_atom.py b/pym/gentoolkit/test/test_atom.py index abafce3..1adb221 100644 --- a/pym/gentoolkit/test/test_atom.py +++ b/pym/gentoolkit/test/test_atom.py @@ -7,7 +7,7 @@ import unittest -from gentoolkit.atom import * +from gentoolkit.atom import Atom from gentoolkit.test import cmp """Atom test suite (verbatim) from pkgcore.""" diff --git a/pym/gentoolkit/test/test_cpv.py b/pym/gentoolkit/test/test_cpv.py index b4de959..fe51a78 100644 --- a/pym/gentoolkit/test/test_cpv.py +++ b/pym/gentoolkit/test/test_cpv.py @@ -8,7 +8,7 @@ import unittest -from gentoolkit.cpv import * +from gentoolkit.cpv import CPV, compare_strs from gentoolkit.test import cmp class TestGentoolkitCPV(unittest.TestCase): diff --git a/pym/gentoolkit/test/test_helpers.py b/pym/gentoolkit/test/test_helpers.py index 729f3dd..81b9edf 100644 --- a/pym/gentoolkit/test/test_helpers.py +++ b/pym/gentoolkit/test/test_helpers.py @@ -2,10 +2,6 @@ import os import unittest import warnings from tempfile import NamedTemporaryFile, mktemp -try: - from test import test_support -except ImportError: - from test import support as test_support from gentoolkit import helpers @@ -18,42 +14,43 @@ class TestChangeLog(unittest.TestCase): def tearDown(self): pass - def test_split_changelog(self): - changelog = """ -*portage-2.1.6.2 (20 Dec 2008) +# Commented out for being useless +# def test_split_changelog(self): +# changelog = """ +# *portage-2.1.6.2 (20 Dec 2008) - 20 Dec 2008; Zac Medico <zmedico@gentoo.org> +portage-2.1.6.2.ebuild: - 2.1.6.2 bump. This fixes bug #251591 (repoman inherit.autotools false - positives) and bug #251616 (performance issue in build log search regex - makes emerge appear to hang). Bug #216231 tracks all bugs fixed since - 2.1.4.x. +# 20 Dec 2008; Zac Medico <zmedico@gentoo.org> +portage-2.1.6.2.ebuild: +# 2.1.6.2 bump. This fixes bug #251591 (repoman inherit.autotools false +# positives) and bug #251616 (performance issue in build log search regex +# makes emerge appear to hang). Bug #216231 tracks all bugs fixed since +# 2.1.4.x. - 20 Dec 2008; Zac Medico <zmedico@gentoo.org> -portage-2.1.6.ebuild, - -portage-2.1.6.1.ebuild, -portage-2.2_rc17.ebuild: - Remove old versions. +# 20 Dec 2008; Zac Medico <zmedico@gentoo.org> -portage-2.1.6.ebuild, +# -portage-2.1.6.1.ebuild, -portage-2.2_rc17.ebuild: +# Remove old versions. -*portage-2.1.6.1 (12 Dec 2008) +# *portage-2.1.6.1 (12 Dec 2008) - 12 Dec 2008; Zac Medico <zmedico@gentoo.org> +portage-2.1.6.1.ebuild: - 2.1.6.1 bump. This fixes bug #250148 (emerge hangs with selinux if ebuild - spawns a daemon), bug #250166 (trigger download when generating manifest - if file size differs from existing entry), and bug #250212 (new repoman - upstream.workaround category for emake -j1 warnings). Bug #216231 tracks - all bugs fixed since 2.1.4.x. +# 12 Dec 2008; Zac Medico <zmedico@gentoo.org> +portage-2.1.6.1.ebuild: +# 2.1.6.1 bump. This fixes bug #250148 (emerge hangs with selinux if ebuild +# spawns a daemon), bug #250166 (trigger download when generating manifest +# if file size differs from existing entry), and bug #250212 (new repoman +# upstream.workaround category for emake -j1 warnings). Bug #216231 tracks +# all bugs fixed since 2.1.4.x. -*portage-2.1.6 (07 Dec 2008) +# *portage-2.1.6 (07 Dec 2008) - 07 Dec 2008; Zac Medico <zmedico@gentoo.org> +portage-2.1.6.ebuild: - 2.1.6 final release. This fixes bug #249586. Bug #216231 tracks all bugs - fixed since 2.1.4.x. +# 07 Dec 2008; Zac Medico <zmedico@gentoo.org> +portage-2.1.6.ebuild: +# 2.1.6 final release. This fixes bug #249586. Bug #216231 tracks all bugs +# fixed since 2.1.4.x. - 07 Dec 2008; Zac Medico <zmedico@gentoo.org> -portage-2.1.6_rc1.ebuild, - -portage-2.1.6_rc2.ebuild, -portage-2.1.6_rc3.ebuild, - -portage-2.2_rc16.ebuild: - Remove old versions. - """ +# 07 Dec 2008; Zac Medico <zmedico@gentoo.org> -portage-2.1.6_rc1.ebuild, +# -portage-2.1.6_rc2.ebuild, -portage-2.1.6_rc3.ebuild, +# -portage-2.2_rc16.ebuild: +# Remove old versions. +# """ class TestFileOwner(unittest.TestCase): diff --git a/pym/gentoolkit/test/test_keyword.py b/pym/gentoolkit/test/test_keyword.py index 9add43a..5d5236b 100644 --- a/pym/gentoolkit/test/test_keyword.py +++ b/pym/gentoolkit/test/test_keyword.py @@ -1,10 +1,7 @@ import sys import unittest -import warnings -from tempfile import NamedTemporaryFile from gentoolkit import keyword -from gentoolkit.test import cmp class TestGentoolkitKeyword(unittest.TestCase): |