Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-catkin-pkg for
openSUSE:Factory checked in at 2022-01-15 21:45:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-catkin-pkg (Old)
and /work/SRC/openSUSE:Factory/.python-catkin-pkg.new.1892 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-catkin-pkg"
Sat Jan 15 21:45:20 2022 rev:6 rq:946697 version:0.4.24
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-catkin-pkg/python-catkin-pkg.changes
2020-07-29 17:21:43.396623548 +0200
+++
/work/SRC/openSUSE:Factory/.python-catkin-pkg.new.1892/python-catkin-pkg.changes
2022-01-15 21:45:45.981632090 +0100
@@ -1,0 +2,11 @@
+Sat Jan 15 18:34:37 UTC 2022 - Dirk M??ller <[email protected]>
+
+- update to 0.4.24:
+ * stop using undocumented docutils api
+ * remove validate_metapacakge wrapper
+ * flake8 warnings
+ * test fixes
+ * add option to show only merge commits
+ * compare dependencies with all attributes
+
+-------------------------------------------------------------------
Old:
----
0.4.22.tar.gz
New:
----
0.4.24.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-catkin-pkg.spec ++++++
--- /var/tmp/diff_new_pack.0nF2tX/_old 2022-01-15 21:45:46.457632342 +0100
+++ /var/tmp/diff_new_pack.0nF2tX/_new 2022-01-15 21:45:46.461632344 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-catkin-pkg
#
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -20,7 +20,7 @@
%define commands create_pkg find_pkg generate_changelog package_version
prepare_release tag_changelog test_changelog
Name: python-catkin-pkg
-Version: 0.4.22
+Version: 0.4.24
Release: 0
Summary: Catkin package library
License: BSD-3-Clause
@@ -34,7 +34,7 @@
Requires: python-python-dateutil
Requires: python-setuptools
Requires(post): update-alternatives
-Requires(postun): update-alternatives
+Requires(postun):update-alternatives
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module docutils}
++++++ 0.4.22.tar.gz -> 0.4.24.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/catkin_pkg-0.4.22/.github/workflows/ci.yaml
new/catkin_pkg-0.4.24/.github/workflows/ci.yaml
--- old/catkin_pkg-0.4.22/.github/workflows/ci.yaml 1970-01-01
01:00:00.000000000 +0100
+++ new/catkin_pkg-0.4.24/.github/workflows/ci.yaml 2021-10-28
06:48:25.000000000 +0200
@@ -0,0 +1,36 @@
+name: catkin_pkg-ci
+
+on:
+ push:
+ branches: [master]
+ pull_request:
+
+jobs:
+ build:
+ strategy:
+ matrix:
+ os: [ubuntu-latest, macos-latest]
+ python: [3.7, 3.8, 3.9]
+ include:
+ - os: ubuntu-18.04
+ python: 2.7
+ - os: macos-latest
+ python: 2.7
+ - os: ubuntu-18.04
+ python: 3.6
+ name: catkin_pkg tests
+ runs-on: ${{matrix.os}}
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up Python ${{matrix.python}}
+ uses: actions/setup-python@v1
+ with:
+ python-version: ${{matrix.python}}
+ - name: Install dependencies
+ run: |
+ python -m pip install argparse coverage docutils mock nose pyparsing
python-dateutil
+ python -m pip install flake8 flake8-blind-except flake8-builtins
flake8-class-newline flake8-comprehensions flake8-deprecated flake8-docstrings
flake8-import-order flake8-quotes
+ - name: Run tests
+ run: |
+ python -m nose -s --tests test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/catkin_pkg-0.4.22/setup.py
new/catkin_pkg-0.4.24/setup.py
--- old/catkin_pkg-0.4.22/setup.py 2020-06-24 19:26:34.000000000 +0200
+++ new/catkin_pkg-0.4.24/setup.py 2021-10-28 06:48:25.000000000 +0200
@@ -20,7 +20,7 @@
# same version as in:
# - src/catkin_pkg/__init__.py
# - stdeb.cfg
- 'version': '0.4.22',
+ 'version': '0.4.24',
'packages': ['catkin_pkg', 'catkin_pkg.cli'],
'package_dir': {'': 'src'},
'package_data': {'catkin_pkg': ['templates/*.in']},
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/catkin_pkg-0.4.22/src/catkin_pkg/__init__.py
new/catkin_pkg-0.4.24/src/catkin_pkg/__init__.py
--- old/catkin_pkg-0.4.22/src/catkin_pkg/__init__.py 2020-06-24
19:26:34.000000000 +0200
+++ new/catkin_pkg-0.4.24/src/catkin_pkg/__init__.py 2021-10-28
06:48:25.000000000 +0200
@@ -35,4 +35,4 @@
# same version as in:
# - setup.py
# - stdeb.cfg
-__version__ = '0.4.22'
+__version__ = '0.4.24'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/catkin_pkg-0.4.22/src/catkin_pkg/changelog.py
new/catkin_pkg-0.4.24/src/catkin_pkg/changelog.py
--- old/catkin_pkg-0.4.22/src/catkin_pkg/changelog.py 2020-06-24
19:26:34.000000000 +0200
+++ new/catkin_pkg-0.4.24/src/catkin_pkg/changelog.py 2021-10-28
06:48:25.000000000 +0200
@@ -231,9 +231,9 @@
elif isinstance(child, docutils.nodes.title) or isinstance(child,
docutils.nodes.subtitle):
version, date = None, None
# See if the title has a text element in it
- if len(child.children) > 0 and isinstance(child.children[0],
docutils.nodes.Text):
+ if len(child.children) > 0 and any(isinstance(c,
docutils.nodes.Text) for c in child.traverse()):
# Extract version and date from (sub-)title
- title_text = child.children[0].rawsource
+ title_text = child.astext()
try:
version, date = version_and_date_from_title(title_text)
except InvalidSectionTitle:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/catkin_pkg-0.4.22/src/catkin_pkg/changelog_generator.py
new/catkin_pkg-0.4.24/src/catkin_pkg/changelog_generator.py
--- old/catkin_pkg-0.4.22/src/catkin_pkg/changelog_generator.py 2020-06-24
19:26:34.000000000 +0200
+++ new/catkin_pkg-0.4.24/src/catkin_pkg/changelog_generator.py 2021-10-28
06:48:25.000000000 +0200
@@ -48,7 +48,7 @@
FORTHCOMING_LABEL = 'Forthcoming'
-def get_all_changes(vcs_client, skip_merges=False):
+def get_all_changes(vcs_client, skip_merges=False, only_merges=False):
tags = _get_version_tags(vcs_client)
# query all log entries per tag range
@@ -56,16 +56,16 @@
previous_tag = Tag(None)
for tag in sorted_tags(tags):
log_entries = vcs_client.get_log_entries(
- from_tag=previous_tag.name, to_tag=tag.name,
skip_merges=skip_merges)
+ from_tag=previous_tag.name, to_tag=tag.name,
skip_merges=skip_merges, only_merges=only_merges)
tag2log_entries[previous_tag] = log_entries
previous_tag = tag
log_entries = vcs_client.get_log_entries(
- from_tag=previous_tag.name, to_tag=None, skip_merges=skip_merges)
+ from_tag=previous_tag.name, to_tag=None, skip_merges=skip_merges,
only_merges=only_merges)
tag2log_entries[previous_tag] = log_entries
return tag2log_entries
-def get_forthcoming_changes(vcs_client, skip_merges=False):
+def get_forthcoming_changes(vcs_client, skip_merges=False, only_merges=False):
tags = _get_version_tags(vcs_client)
latest_tag_name = _get_latest_version_tag_name(vcs_client)
@@ -79,7 +79,7 @@
# ignore non-forthcoming log entries but keep version to identify
injection point of forthcoming
tag2log_entries[tag] = None
log_entries = vcs_client.get_log_entries(
- from_tag=from_tag.name, to_tag=to_tag.name, skip_merges=skip_merges)
+ from_tag=from_tag.name, to_tag=to_tag.name, skip_merges=skip_merges,
only_merges=only_merges)
tag2log_entries[from_tag] = log_entries
return tag2log_entries
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/catkin_pkg-0.4.22/src/catkin_pkg/changelog_generator_vcs.py
new/catkin_pkg-0.4.24/src/catkin_pkg/changelog_generator_vcs.py
--- old/catkin_pkg-0.4.22/src/catkin_pkg/changelog_generator_vcs.py
2020-06-24 19:26:34.000000000 +0200
+++ new/catkin_pkg-0.4.24/src/catkin_pkg/changelog_generator_vcs.py
2021-10-28 06:48:25.000000000 +0200
@@ -88,7 +88,7 @@
def get_latest_tag_name(self):
raise NotImplementedError()
- def get_log_entries(self, from_tag, to_tag, skip_merges=False):
+ def get_log_entries(self, from_tag, to_tag, skip_merges=False,
only_merges=False):
raise NotImplementedError()
def replace_repository_references(self, line):
@@ -179,14 +179,18 @@
tag_name = result_describe['output']
return tag_name
- def get_log_entries(self, from_tag, to_tag, skip_merges=False):
+ def get_log_entries(self, from_tag, to_tag, skip_merges=False,
only_merges=False):
# query all hashes in the range
cmd = [self._executable, 'log']
if from_tag or to_tag:
cmd.append('%s%s' % ('%s..' % to_tag if to_tag else '', from_tag
if from_tag else ''))
cmd.append('--format=format:%H')
+ if skip_merges and only_merges:
+ raise RuntimeError('Both "skip_merges" and "only_merges" are set
to True, which contradicts.')
if skip_merges:
cmd.append('--no-merges')
+ if only_merges:
+ cmd.append('--merges')
result = self._run_command(cmd)
if result['returncode']:
raise RuntimeError('Could not fetch commit hashes:\n%s' %
result['output'])
@@ -348,7 +352,7 @@
raise RuntimeError('Could not find latest tagn')
return tag_name
- def get_log_entries(self, from_tag, to_tag, skip_merges=False):
+ def get_log_entries(self, from_tag, to_tag, skip_merges=False,
only_merges=False):
# query all hashes in the range
# ascending chronological order since than it is easier to handle
empty tag names
revrange = '%s:%s' % ((to_tag if to_tag else ''), (from_tag if
from_tag else 'tip'))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/catkin_pkg-0.4.22/src/catkin_pkg/cli/generate_changelog.py
new/catkin_pkg-0.4.24/src/catkin_pkg/cli/generate_changelog.py
--- old/catkin_pkg-0.4.22/src/catkin_pkg/cli/generate_changelog.py
2020-06-24 19:26:34.000000000 +0200
+++ new/catkin_pkg-0.4.24/src/catkin_pkg/cli/generate_changelog.py
2021-10-28 06:48:25.000000000 +0200
@@ -40,16 +40,20 @@
def main(sysargs=None):
parser = argparse.ArgumentParser(description='Generate a REP-0132 %s' %
CHANGELOG_FILENAME)
+ group_merge = parser.add_mutually_exclusive_group()
parser.add_argument(
'-a', '--all', action='store_true', default=False,
help='Generate changelog for all versions instead of only the
forthcoming one (only supported when no changelog file exists yet)')
+ group_merge.add_argument(
+ '--only-merges', action='store_true', default=False,
+ help='Only add merge commits to the changelog')
parser.add_argument(
'--print-root', action='store_true', default=False,
help='Output changelog content to the console as if there would be
only one package in the root of the repository')
parser.add_argument(
'--skip-contributors', action='store_true', default=False,
help='Skip adding the list of contributors to the changelog')
- parser.add_argument(
+ group_merge.add_argument(
'--skip-merges', action='store_true', default=False,
help='Skip adding merge commits to the changelog')
parser.add_argument(
@@ -66,11 +70,11 @@
# printing status messages to stderr to allow piping the changelog to
a file
if args.all:
print('Querying all tags and commit information...',
file=sys.stderr)
- tag2log_entries = get_all_changes(vcs_client,
skip_merges=args.skip_merges)
+ tag2log_entries = get_all_changes(vcs_client,
skip_merges=args.skip_merges, only_merges=args.only_merges)
print('Generating changelog output with all versions...',
file=sys.stderr)
else:
print('Querying commit information since latest tag...',
file=sys.stderr)
- tag2log_entries = get_forthcoming_changes(vcs_client,
skip_merges=args.skip_merges)
+ tag2log_entries = get_forthcoming_changes(vcs_client,
skip_merges=args.skip_merges, only_merges=args.only_merges)
print('Generating changelog files with forthcoming version...',
file=sys.stderr)
print('', file=sys.stderr)
data = generate_changelog_file('repository-level', tag2log_entries,
vcs_client=vcs_client)
@@ -106,12 +110,12 @@
if args.all:
print('Querying all tags and commit information...')
- tag2log_entries = get_all_changes(vcs_client,
skip_merges=args.skip_merges)
+ tag2log_entries = get_all_changes(vcs_client,
skip_merges=args.skip_merges, only_merges=args.only_merges)
print('Generating changelog files with all versions...')
generate_changelogs(base_path, packages, tag2log_entries,
logger=logging, vcs_client=vcs_client, skip_contributors=args.skip_contributors)
else:
print('Querying commit information since latest tag...')
- tag2log_entries = get_forthcoming_changes(vcs_client,
skip_merges=args.skip_merges)
+ tag2log_entries = get_forthcoming_changes(vcs_client,
skip_merges=args.skip_merges, only_merges=args.only_merges)
# separate packages with/without a changelog file
packages_without = {pkg_path: package for pkg_path, package in
packages.items() if package.name in missing_changelogs}
if packages_without:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/catkin_pkg-0.4.22/src/catkin_pkg/cli/package_version.py
new/catkin_pkg-0.4.24/src/catkin_pkg/cli/package_version.py
--- old/catkin_pkg-0.4.22/src/catkin_pkg/cli/package_version.py 2020-06-24
19:26:34.000000000 +0200
+++ new/catkin_pkg-0.4.24/src/catkin_pkg/cli/package_version.py 2021-10-28
06:48:25.000000000 +0200
@@ -35,5 +35,5 @@
new_version = bump_version(version, args.bump)
update_versions(packages.keys(), new_version)
print('%s -> %s' % (version, new_version))
- except Exception as e:
+ except Exception as e: # noqa: B902
sys.exit(str(e))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/catkin_pkg-0.4.22/src/catkin_pkg/cmake.py
new/catkin_pkg-0.4.24/src/catkin_pkg/cmake.py
--- old/catkin_pkg-0.4.22/src/catkin_pkg/cmake.py 2020-06-24
19:26:34.000000000 +0200
+++ new/catkin_pkg-0.4.24/src/catkin_pkg/cmake.py 2021-10-28
06:48:25.000000000 +0200
@@ -47,7 +47,7 @@
return os.path.join(os.path.dirname(__file__), rel_path)
-def configure_file(template_file, environment): # noqa: D402
+def configure_file(template_file, environment):
"""
Evaluate a .in template file used in CMake with configure_file().
@@ -57,7 +57,7 @@
:returns: string with evaluates template
:raises: KeyError for placeholders in the template which are not
in the environment
- """
+ """ # noqa: D402
with open(template_file, 'r') as f:
template = f.read()
return configure_string(template, environment)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/catkin_pkg-0.4.22/src/catkin_pkg/condition.py
new/catkin_pkg-0.4.24/src/catkin_pkg/condition.py
--- old/catkin_pkg-0.4.22/src/catkin_pkg/condition.py 2020-06-24
19:26:34.000000000 +0200
+++ new/catkin_pkg-0.4.24/src/catkin_pkg/condition.py 2021-10-28
06:48:25.000000000 +0200
@@ -50,7 +50,15 @@
value = pp.Word(pp.alphanums + '_-').setName('value')
value.setParseAction(_Value)
- comparison_term = identifier | value
+ double_quoted_value = pp.QuotedString('"').setName(
+ 'double_quoted_value')
+ double_quoted_value.setParseAction(_Value)
+ single_quoted_value = pp.QuotedString("'").setName(
+ 'single_quoted_value')
+ single_quoted_value.setParseAction(_Value)
+
+ comparison_term = identifier | value | double_quoted_value | \
+ single_quoted_value
condition = pp.Group(comparison_term + operator +
comparison_term).setName('condition')
condition.setParseAction(_Condition)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/catkin_pkg-0.4.22/src/catkin_pkg/package.py
new/catkin_pkg-0.4.24/src/catkin_pkg/package.py
--- old/catkin_pkg-0.4.22/src/catkin_pkg/package.py 2020-06-24
19:26:34.000000000 +0200
+++ new/catkin_pkg-0.4.24/src/catkin_pkg/package.py 2021-10-28
06:48:25.000000000 +0200
@@ -39,6 +39,7 @@
import re
import sys
import xml.dom.minidom as dom
+from xml.parsers.expat import ExpatError
from catkin_pkg.condition import evaluate_condition
@@ -338,7 +339,7 @@
def __eq__(self, other):
if not isinstance(other, Dependency):
return False
- return all(getattr(self, attr) == getattr(other, attr) for attr in
self.__slots__)
+ return all(getattr(self, attr) == getattr(other, attr) for attr in
self.__slots__ if attr != 'evaluated_condition')
def __hash__(self):
return hash(tuple(getattr(self, slot) for slot in self.__slots__))
@@ -539,7 +540,7 @@
data = data.encode('utf-8')
try:
root = dom.parseString(data)
- except Exception:
+ except ExpatError:
# invalid XML
return False
@@ -594,7 +595,7 @@
data = data.encode('utf-8')
try:
root = dom.parseString(data)
- except Exception as ex:
+ except ExpatError as ex:
raise InvalidPackage('The manifest contains invalid XML:\n%s' % ex,
filename)
pkg = Package(filename)
@@ -672,9 +673,9 @@
depends = _get_dependencies(root, 'depend')
for dep in depends:
# check for collisions with specific dependencies
- same_build_depends = ['build_depend' for d in pkg.build_depends if
d.name == dep.name]
- same_build_export_depends = ['build_export_depend' for d in
pkg.build_export_depends if d.name == dep.name]
- same_exec_depends = ['exec_depend' for d in pkg.exec_depends if
d.name == dep.name]
+ same_build_depends = ['build_depend' for d in pkg.build_depends if
d == dep]
+ same_build_export_depends = ['build_export_depend' for d in
pkg.build_export_depends if d == dep]
+ same_exec_depends = ['exec_depend' for d in pkg.exec_depends if d
== dep]
if same_build_depends or same_build_export_depends or
same_exec_depends:
errors.append("The generic dependency on '%s' is redundant
with: %s" % (dep.name, ', '.join(same_build_depends + same_build_export_depends
+ same_exec_depends)))
# only append non-duplicates
@@ -695,8 +696,8 @@
if pkg.package_format == 1:
for test_depend in pkg.test_depends:
- same_build_depends = ['build_depend' for d in pkg.build_depends if
d.name == test_depend.name]
- same_run_depends = ['run_depend' for d in pkg.run_depends if
d.name == test_depend.name]
+ same_build_depends = ['build_depend' for d in pkg.build_depends if
d == test_depend]
+ same_run_depends = ['run_depend' for d in pkg.run_depends if d ==
test_depend]
if same_build_depends or same_run_depends:
errors.append('The test dependency on "%s" is redundant with:
%s' % (test_depend.name, ', '.join(same_build_depends + same_run_depends)))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/catkin_pkg-0.4.22/stdeb.cfg
new/catkin_pkg-0.4.24/stdeb.cfg
--- old/catkin_pkg-0.4.22/stdeb.cfg 2020-06-24 19:26:34.000000000 +0200
+++ new/catkin_pkg-0.4.24/stdeb.cfg 2021-10-28 06:48:25.000000000 +0200
@@ -3,11 +3,11 @@
; catkin-pkg-modules same version as in:
; - setup.py
; - src/catkin_pkg/__init__.py
-Depends: python-argparse, python-catkin-pkg-modules (>= 0.4.22),
python-dateutil, python-docutils
+Depends: python-argparse, python-catkin-pkg-modules (>= 0.4.24),
python-dateutil, python-docutils
; catkin-pkg-modules same version as in:
; - setup.py
; - src/catkin_pkg/__init__.py
-Depends3: python3-catkin-pkg-modules (>= 0.4.22), python3-dateutil,
python3-docutils
+Depends3: python3-catkin-pkg-modules (>= 0.4.24), python3-dateutil,
python3-docutils
Conflicts: catkin, python3-catkin-pkg
Conflicts3: catkin, python-catkin-pkg
Copyright-File: LICENSE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/catkin_pkg-0.4.22/test/test_metapackage.py
new/catkin_pkg-0.4.24/test/test_metapackage.py
--- old/catkin_pkg-0.4.22/test/test_metapackage.py 2020-06-24
19:26:34.000000000 +0200
+++ new/catkin_pkg-0.4.24/test/test_metapackage.py 2021-10-28
06:48:25.000000000 +0200
@@ -61,14 +61,6 @@
sys.stderr = orig_stderr
-def _validate_metapackage(path, package):
- try:
- validate_metapackage(path, package)
- except Exception:
- # print('on package ' + package.name, file=sys.stderr)
- raise
-
-
class TestMetapackageValidation(unittest.TestCase):
"""Tests the metapackage validator."""
@@ -85,12 +77,12 @@
if exc is not None:
if excreg is not None:
with self.assertRaisesRegex(exc, excreg):
- _validate_metapackage(path, package)
+ validate_metapackage(path, package)
else:
with self.assertRaises(exc):
- _validate_metapackage(path, package)
+ validate_metapackage(path, package)
else:
- _validate_metapackage(path, package)
+ validate_metapackage(path, package)
def test_collect_warnings(self):
"""Tests warnings collection."""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/catkin_pkg-0.4.22/test/test_package.py
new/catkin_pkg-0.4.24/test/test_package.py
--- old/catkin_pkg-0.4.22/test/test_package.py 2020-06-24 19:26:34.000000000
+0200
+++ new/catkin_pkg-0.4.24/test/test_package.py 2021-10-28 06:48:25.000000000
+0200
@@ -4,6 +4,7 @@
import unittest
import xml.dom.minidom as dom
+from xml.parsers.expat import ExpatError
from catkin_pkg.package import (
_check_known_attributes,
@@ -121,6 +122,22 @@
dep = Dependency('foo', condition='foo <= bar or bar >= baz')
self.assertFalse(dep.evaluate_condition({}))
+ dep = Dependency('foo', condition='$foo == ""')
+ self.assertTrue(dep.evaluate_condition({}))
+ self.assertFalse(dep.evaluate_condition({'foo': 'foo'}))
+
+ dep = Dependency('foo', condition='$foo == "foo \' bar"')
+ self.assertTrue(dep.evaluate_condition({'foo': "foo ' bar"}))
+ self.assertFalse(dep.evaluate_condition({}))
+
+ dep = Dependency('foo', condition="$foo == ''")
+ self.assertTrue(dep.evaluate_condition({}))
+ self.assertFalse(dep.evaluate_condition({'foo': 'foo'}))
+
+ dep = Dependency('foo', condition="$foo == 'foo \" bar'")
+ self.assertTrue(dep.evaluate_condition({'foo': 'foo " bar'}))
+ self.assertFalse(dep.evaluate_condition({}))
+
# Testing for more than 1 conditions
dep = Dependency('foo', condition='foo > bar and bar < baz and foo >
bar')
self.assertTrue(dep.evaluate_condition({}))
@@ -321,14 +338,14 @@
try:
create_node('tag', {'key': 'value'})
- except Exception as e:
+ except ExpatError as e:
self.fail('create_node() raised %s "%s" unexpectedly!' % (type(e),
str(e)))
self.assertRaisesRegex(Exception, 'unbound prefix: line 1, column 0',
create_node, 'tag', {'ns:key': 'value'})
try:
create_node('tag', {'ns:key': 'value', 'xmlns:ns': 'urn:ns'})
- except Exception as e:
+ except ExpatError as e:
self.fail('create_node() raised %s "%s" unexpectedly!' % (type(e),
str(e)))
def check(attrs, known, res=[]):
@@ -376,6 +393,38 @@
assert isinstance(xml, bytes)
parse_package_string(xml)
+ xml_string = """
+<package>
+ <name>valid_package</name>
+ <version>0.1.0</version>
+ <description>valid_package description</description>
+ <maintainer email="[email protected]>Forgotten end quote</maintainer>
+ <license>BSD</license>
+</package>
+"""
+ self.assertRaises(InvalidPackage, parse_package_string, xml_string)
+
+ xml_string = """
+<package>
+ <name>valid_package</name>
+ <version>0.1.0</version>
+ <description>Invalid < character in description</description>
+ <maintainer email="[email protected]">user</maintainer>
+ <license>BSD</license>
+</package>
+"""
+ self.assertRaises(InvalidPackage, parse_package_string, xml_string)
+ xml_string = """
+<package>
+ <name>valid_package</name>
+ <version>0.1.0</version>
+ <description>valid_package description</description>
+ <maintainer email="[email protected]">user</maintainer>
+ <license>BSD</license>
+</package><extra>Unwanted junk</extra>
+"""
+ self.assertRaises(InvalidPackage, parse_package_string, xml_string)
+
def test_has_ros_schema_reference_string(self):
self.assertFalse(
has_ros_schema_reference_string(