diff options
author | Stephen Finucane <sfinucan@redhat.com> | 2019-08-26 22:00:28 +0100 |
---|---|---|
committer | Stephen Finucane <sfinucan@redhat.com> | 2019-08-27 16:57:23 +0100 |
commit | 57d7c53739487e9fa0051ae12d8609acebaaf0e1 (patch) | |
tree | 2b177be5f180b3a09a07ca366994f1d5d1cf3b67 /pbr/tests | |
parent | fa0dd5652d82f8d238742f2d50c5514dec6f29a8 (diff) | |
download | pbr-57d7c53739487e9fa0051ae12d8609acebaaf0e1.tar.gz |
Update to latest hacking
Change-Id: If73238a39d0934c6f577fc52132fcbc63e8eb25f
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Diffstat (limited to 'pbr/tests')
-rw-r--r-- | pbr/tests/test_packaging.py | 212 | ||||
-rw-r--r-- | pbr/tests/test_setup.py | 6 | ||||
-rw-r--r-- | pbr/tests/testpackage/doc/source/conf.py | 17 | ||||
-rw-r--r-- | pbr/tests/util.py | 4 |
4 files changed, 114 insertions, 125 deletions
diff --git a/pbr/tests/test_packaging.py b/pbr/tests/test_packaging.py index c7dafda..9a3778e 100644 --- a/pbr/tests/test_packaging.py +++ b/pbr/tests/test_packaging.py @@ -765,8 +765,10 @@ class TestVersions(base.BaseTestCase): def test_get_kwargs_corner_cases(self): # No tags: - git_dir = self.repo._basedir + '/.git' - get_kwargs = lambda tag: packaging._get_increment_kwargs(git_dir, tag) + + def get_kwargs(tag): + git_dir = self.repo._basedir + '/.git' + return packaging._get_increment_kwargs(git_dir, tag) def _check_combinations(tag): self.repo.commit() @@ -947,109 +949,109 @@ class TestRepositoryURLDependencies(base.BaseTestCase): 'pypi-proj1', 'pypi-proj2'])) def test_egg_fragment(self): - expected = [ - 'django-thumborize', - 'django-thumborize-beta', - 'django-thumborize2-beta', - 'django-thumborize2-beta>=4.0.1', - 'django-thumborize2-beta>=1.0.0-alpha.beta.1', - 'django-thumborize2-beta>=1.0.0-alpha-a.b-c-long+build.1-aef.1-its-okay', # noqa - 'django-thumborize2-beta>=2.0.0-rc.1+build.123', - 'django-thumborize-beta>=0.0.4', - 'django-thumborize-beta>=1.2.3', - 'django-thumborize-beta>=10.20.30', - 'django-thumborize-beta>=1.1.2-prerelease+meta', - 'django-thumborize-beta>=1.1.2+meta', - 'django-thumborize-beta>=1.1.2+meta-valid', - 'django-thumborize-beta>=1.0.0-alpha', - 'django-thumborize-beta>=1.0.0-beta', - 'django-thumborize-beta>=1.0.0-alpha.beta', - 'django-thumborize-beta>=1.0.0-alpha.beta.1', - 'django-thumborize-beta>=1.0.0-alpha.1', - 'django-thumborize-beta>=1.0.0-alpha0.valid', - 'django-thumborize-beta>=1.0.0-alpha.0valid', - 'django-thumborize-beta>=1.0.0-alpha-a.b-c-somethinglong+build.1-aef.1-its-okay', # noqa - 'django-thumborize-beta>=1.0.0-rc.1+build.1', - 'django-thumborize-beta>=2.0.0-rc.1+build.123', - 'django-thumborize-beta>=1.2.3-beta', - 'django-thumborize-beta>=10.2.3-DEV-SNAPSHOT', - 'django-thumborize-beta>=1.2.3-SNAPSHOT-123', - 'django-thumborize-beta>=1.0.0', - 'django-thumborize-beta>=2.0.0', - 'django-thumborize-beta>=1.1.7', - 'django-thumborize-beta>=2.0.0+build.1848', - 'django-thumborize-beta>=2.0.1-alpha.1227', - 'django-thumborize-beta>=1.0.0-alpha+beta', - 'django-thumborize-beta>=1.2.3----RC-SNAPSHOT.12.9.1--.12+788', - 'django-thumborize-beta>=1.2.3----R-S.12.9.1--.12+meta', - 'django-thumborize-beta>=1.2.3----RC-SNAPSHOT.12.9.1--.12', - 'django-thumborize-beta>=1.0.0+0.build.1-rc.10000aaa-kk-0.1', - 'django-thumborize-beta>=999999999999999999.99999999999999.9999999999999', # noqa - 'Proj1', - 'Proj2>=0.0.1', - 'Proj3', - 'Proj4>=0.0.2', - 'Proj5', - 'Proj>=0.0.3', - 'Proj', - 'Proj>=0.0.4', - 'Proj', - 'foo-bar>=1.2.4', - ] - tests = [ - 'egg=django-thumborize', - 'egg=django-thumborize-beta', - 'egg=django-thumborize2-beta', - 'egg=django-thumborize2-beta-4.0.1', - 'egg=django-thumborize2-beta-1.0.0-alpha.beta.1', - 'egg=django-thumborize2-beta-1.0.0-alpha-a.b-c-long+build.1-aef.1-its-okay', # noqa - 'egg=django-thumborize2-beta-2.0.0-rc.1+build.123', - 'egg=django-thumborize-beta-0.0.4', - 'egg=django-thumborize-beta-1.2.3', - 'egg=django-thumborize-beta-10.20.30', - 'egg=django-thumborize-beta-1.1.2-prerelease+meta', - 'egg=django-thumborize-beta-1.1.2+meta', - 'egg=django-thumborize-beta-1.1.2+meta-valid', - 'egg=django-thumborize-beta-1.0.0-alpha', - 'egg=django-thumborize-beta-1.0.0-beta', - 'egg=django-thumborize-beta-1.0.0-alpha.beta', - 'egg=django-thumborize-beta-1.0.0-alpha.beta.1', - 'egg=django-thumborize-beta-1.0.0-alpha.1', - 'egg=django-thumborize-beta-1.0.0-alpha0.valid', - 'egg=django-thumborize-beta-1.0.0-alpha.0valid', - 'egg=django-thumborize-beta-1.0.0-alpha-a.b-c-somethinglong+build.1-aef.1-its-okay', # noqa - 'egg=django-thumborize-beta-1.0.0-rc.1+build.1', - 'egg=django-thumborize-beta-2.0.0-rc.1+build.123', - 'egg=django-thumborize-beta-1.2.3-beta', - 'egg=django-thumborize-beta-10.2.3-DEV-SNAPSHOT', - 'egg=django-thumborize-beta-1.2.3-SNAPSHOT-123', - 'egg=django-thumborize-beta-1.0.0', - 'egg=django-thumborize-beta-2.0.0', - 'egg=django-thumborize-beta-1.1.7', - 'egg=django-thumborize-beta-2.0.0+build.1848', - 'egg=django-thumborize-beta-2.0.1-alpha.1227', - 'egg=django-thumborize-beta-1.0.0-alpha+beta', - 'egg=django-thumborize-beta-1.2.3----RC-SNAPSHOT.12.9.1--.12+788', # noqa - 'egg=django-thumborize-beta-1.2.3----R-S.12.9.1--.12+meta', - 'egg=django-thumborize-beta-1.2.3----RC-SNAPSHOT.12.9.1--.12', - 'egg=django-thumborize-beta-1.0.0+0.build.1-rc.10000aaa-kk-0.1', # noqa - 'egg=django-thumborize-beta-999999999999999999.99999999999999.9999999999999', # noqa - 'egg=Proj1', - 'egg=Proj2-0.0.1', - 'egg=Proj3', - 'egg=Proj4-0.0.2', - 'egg=Proj5', - 'egg=Proj-0.0.3', - 'egg=Proj', - 'egg=Proj-0.0.4', - 'egg=Proj', - 'egg=foo-bar-1.2.4', - ] - for index, test in enumerate(tests): - self.assertEqual(expected[index], - re.sub(r'egg=([^&]+).*$', - packaging.egg_fragment, - test)) + expected = [ + 'django-thumborize', + 'django-thumborize-beta', + 'django-thumborize2-beta', + 'django-thumborize2-beta>=4.0.1', + 'django-thumborize2-beta>=1.0.0-alpha.beta.1', + 'django-thumborize2-beta>=1.0.0-alpha-a.b-c-long+build.1-aef.1-its-okay', # noqa + 'django-thumborize2-beta>=2.0.0-rc.1+build.123', + 'django-thumborize-beta>=0.0.4', + 'django-thumborize-beta>=1.2.3', + 'django-thumborize-beta>=10.20.30', + 'django-thumborize-beta>=1.1.2-prerelease+meta', + 'django-thumborize-beta>=1.1.2+meta', + 'django-thumborize-beta>=1.1.2+meta-valid', + 'django-thumborize-beta>=1.0.0-alpha', + 'django-thumborize-beta>=1.0.0-beta', + 'django-thumborize-beta>=1.0.0-alpha.beta', + 'django-thumborize-beta>=1.0.0-alpha.beta.1', + 'django-thumborize-beta>=1.0.0-alpha.1', + 'django-thumborize-beta>=1.0.0-alpha0.valid', + 'django-thumborize-beta>=1.0.0-alpha.0valid', + 'django-thumborize-beta>=1.0.0-alpha-a.b-c-somethinglong+build.1-aef.1-its-okay', # noqa + 'django-thumborize-beta>=1.0.0-rc.1+build.1', + 'django-thumborize-beta>=2.0.0-rc.1+build.123', + 'django-thumborize-beta>=1.2.3-beta', + 'django-thumborize-beta>=10.2.3-DEV-SNAPSHOT', + 'django-thumborize-beta>=1.2.3-SNAPSHOT-123', + 'django-thumborize-beta>=1.0.0', + 'django-thumborize-beta>=2.0.0', + 'django-thumborize-beta>=1.1.7', + 'django-thumborize-beta>=2.0.0+build.1848', + 'django-thumborize-beta>=2.0.1-alpha.1227', + 'django-thumborize-beta>=1.0.0-alpha+beta', + 'django-thumborize-beta>=1.2.3----RC-SNAPSHOT.12.9.1--.12+788', + 'django-thumborize-beta>=1.2.3----R-S.12.9.1--.12+meta', + 'django-thumborize-beta>=1.2.3----RC-SNAPSHOT.12.9.1--.12', + 'django-thumborize-beta>=1.0.0+0.build.1-rc.10000aaa-kk-0.1', + 'django-thumborize-beta>=999999999999999999.99999999999999.9999999999999', # noqa + 'Proj1', + 'Proj2>=0.0.1', + 'Proj3', + 'Proj4>=0.0.2', + 'Proj5', + 'Proj>=0.0.3', + 'Proj', + 'Proj>=0.0.4', + 'Proj', + 'foo-bar>=1.2.4', + ] + tests = [ + 'egg=django-thumborize', + 'egg=django-thumborize-beta', + 'egg=django-thumborize2-beta', + 'egg=django-thumborize2-beta-4.0.1', + 'egg=django-thumborize2-beta-1.0.0-alpha.beta.1', + 'egg=django-thumborize2-beta-1.0.0-alpha-a.b-c-long+build.1-aef.1-its-okay', # noqa + 'egg=django-thumborize2-beta-2.0.0-rc.1+build.123', + 'egg=django-thumborize-beta-0.0.4', + 'egg=django-thumborize-beta-1.2.3', + 'egg=django-thumborize-beta-10.20.30', + 'egg=django-thumborize-beta-1.1.2-prerelease+meta', + 'egg=django-thumborize-beta-1.1.2+meta', + 'egg=django-thumborize-beta-1.1.2+meta-valid', + 'egg=django-thumborize-beta-1.0.0-alpha', + 'egg=django-thumborize-beta-1.0.0-beta', + 'egg=django-thumborize-beta-1.0.0-alpha.beta', + 'egg=django-thumborize-beta-1.0.0-alpha.beta.1', + 'egg=django-thumborize-beta-1.0.0-alpha.1', + 'egg=django-thumborize-beta-1.0.0-alpha0.valid', + 'egg=django-thumborize-beta-1.0.0-alpha.0valid', + 'egg=django-thumborize-beta-1.0.0-alpha-a.b-c-somethinglong+build.1-aef.1-its-okay', # noqa + 'egg=django-thumborize-beta-1.0.0-rc.1+build.1', + 'egg=django-thumborize-beta-2.0.0-rc.1+build.123', + 'egg=django-thumborize-beta-1.2.3-beta', + 'egg=django-thumborize-beta-10.2.3-DEV-SNAPSHOT', + 'egg=django-thumborize-beta-1.2.3-SNAPSHOT-123', + 'egg=django-thumborize-beta-1.0.0', + 'egg=django-thumborize-beta-2.0.0', + 'egg=django-thumborize-beta-1.1.7', + 'egg=django-thumborize-beta-2.0.0+build.1848', + 'egg=django-thumborize-beta-2.0.1-alpha.1227', + 'egg=django-thumborize-beta-1.0.0-alpha+beta', + 'egg=django-thumborize-beta-1.2.3----RC-SNAPSHOT.12.9.1--.12+788', # noqa + 'egg=django-thumborize-beta-1.2.3----R-S.12.9.1--.12+meta', + 'egg=django-thumborize-beta-1.2.3----RC-SNAPSHOT.12.9.1--.12', + 'egg=django-thumborize-beta-1.0.0+0.build.1-rc.10000aaa-kk-0.1', # noqa + 'egg=django-thumborize-beta-999999999999999999.99999999999999.9999999999999', # noqa + 'egg=Proj1', + 'egg=Proj2-0.0.1', + 'egg=Proj3', + 'egg=Proj4-0.0.2', + 'egg=Proj5', + 'egg=Proj-0.0.3', + 'egg=Proj', + 'egg=Proj-0.0.4', + 'egg=Proj', + 'egg=foo-bar-1.2.4', + ] + for index, test in enumerate(tests): + self.assertEqual(expected[index], + re.sub(r'egg=([^&]+).*$', + packaging.egg_fragment, + test)) def test_parse_repo_url_requirements(self): result = packaging.parse_requirements([self.requirements]) diff --git a/pbr/tests/test_setup.py b/pbr/tests/test_setup.py index 0e60df7..d171d7c 100644 --- a/pbr/tests/test_setup.py +++ b/pbr/tests/test_setup.py @@ -93,8 +93,9 @@ class SkipFileWrites(base.BaseTestCase): option_dict=self.option_dict) self.assertEqual( not os.path.exists(self.filename), - (self.option_value.lower() in options.TRUE_VALUES - or self.env_value is not None)) + (self.option_value.lower() in options.TRUE_VALUES or + self.env_value is not None)) + _changelog_content = """7780758\x00Break parser\x00 (tag: refs/tags/1_foo.1) 04316fe\x00Make python\x00 (refs/heads/review/monty_taylor/27519) @@ -125,6 +126,7 @@ def _make_old_git_changelog_format(line): refname = refname.replace('tag: ', '') return '\x00'.join((sha, msg, refname)) + _old_git_changelog_content = '\n'.join( _make_old_git_changelog_format(line) for line in _changelog_content.split('\n')) diff --git a/pbr/tests/testpackage/doc/source/conf.py b/pbr/tests/testpackage/doc/source/conf.py index 7358510..6edbe8e 100644 --- a/pbr/tests/testpackage/doc/source/conf.py +++ b/pbr/tests/testpackage/doc/source/conf.py @@ -12,17 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os -import sys -sys.path.insert(0, os.path.abspath('../..')) # -- General configuration ---------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ 'sphinx.ext.autodoc', - #'sphinx.ext.intersphinx', ] # autodoc generation is a bit aggressive and a nuisance when doing heavy @@ -49,16 +45,8 @@ add_module_names = True # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' -# -- Options for HTML output -------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. Major themes that come with -# Sphinx are currently 'default' and 'sphinxdoc'. -# html_theme_path = ["."] -# html_theme = '_theme' -# html_static_path = ['static'] -# Output file base name for HTML help builder. -htmlhelp_basename = '%sdoc' % project +# -- Options for HTML output -------------------------------------------------- # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass @@ -69,6 +57,3 @@ latex_documents = [ u'%s Documentation' % project, u'OpenStack Foundation', 'manual'), ] - -# Example configuration for intersphinx: refer to the Python standard library. -#intersphinx_mapping = {'http://docs.python.org/': None} diff --git a/pbr/tests/util.py b/pbr/tests/util.py index 0e7bcf1..8a00c84 100644 --- a/pbr/tests/util.py +++ b/pbr/tests/util.py @@ -53,9 +53,9 @@ except ImportError: @contextlib.contextmanager def open_config(filename): if sys.version_info >= (3, 2): - cfg = configparser.ConfigParser() + cfg = configparser.ConfigParser() else: - cfg = configparser.SafeConfigParser() + cfg = configparser.SafeConfigParser() cfg.read(filename) yield cfg with open(filename, 'w') as fp: |