Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package cepces for openSUSE:Factory checked in at 2021-07-20 15:39:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/cepces (Old) and /work/SRC/openSUSE:Factory/.cepces.new.2632 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "cepces" Tue Jul 20 15:39:25 2021 rev:3 rq:907158 version:0.3.4 Changes: -------- --- /work/SRC/openSUSE:Factory/cepces/cepces.changes 2021-07-16 22:13:25.426541212 +0200 +++ /work/SRC/openSUSE:Factory/.cepces.new.2632/cepces.changes 2021-07-20 15:40:08.689545430 +0200 @@ -1,0 +2,6 @@ +Mon Jul 19 14:32:34 UTC 2021 - David Mulder <dmul...@suse.com> + +- Fix configuration missing global section. +- Add a test runner for executing unittests, and github CI. + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ cepces.spec ++++++ --- /var/tmp/diff_new_pack.Ugl43h/_old 2021-07-20 15:40:09.177546303 +0200 +++ /var/tmp/diff_new_pack.Ugl43h/_new 2021-07-20 15:40:09.177546303 +0200 @@ -157,7 +157,9 @@ fi %check -%{__python3} setup.py test +pushd tests +%{__python3} ./runner.py +popd %files %doc LICENSE ++++++ cepces-0.3.4.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cepces-0.3.4/.github/workflows/ci.yml new/cepces-0.3.4/.github/workflows/ci.yml --- old/cepces-0.3.4/.github/workflows/ci.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/cepces-0.3.4/.github/workflows/ci.yml 2021-07-19 16:14:02.000000000 +0200 @@ -0,0 +1,25 @@ +name: Run Python Tests +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install Python 3 + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - name: Install dependencies + run: | + sudo apt-get install libkrb5-dev + python3 -m pip install --upgrade pip + pip3 install -r requirements.txt + - name: Run tests + run: pushd tests; python3 runner.py; popd diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cepces-0.3.4/bin/cepces-submit new/cepces-0.3.4/bin/cepces-submit --- old/cepces-0.3.4/bin/cepces-submit 2021-07-14 21:44:47.000000000 +0200 +++ new/cepces-0.3.4/bin/cepces-submit 2021-07-19 16:14:02.000000000 +0200 @@ -60,8 +60,8 @@ else: try: # Load the configuration and instantiate a service. - config = Configuration.load(global_overrides, - krb5_overrides) + config = Configuration.load(global_overrides=global_overrides, + krb5_overrides=krb5_overrides) service = Service(config) # Call the operation. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cepces-0.3.4/cepces/wstep/service.py new/cepces-0.3.4/cepces/wstep/service.py --- old/cepces-0.3.4/cepces/wstep/service.py 2021-07-14 21:44:47.000000000 +0200 +++ new/cepces-0.3.4/cepces/wstep/service.py 2021-07-19 16:14:02.000000000 +0200 @@ -119,7 +119,7 @@ results.append( Service.Response( request_id=response.request_id, - reference=response.token.token_reference.reference.uri, + reference=response.requested_token.token_reference.reference.uri, ), ) @@ -167,7 +167,7 @@ results.append( Service.Response( request_id=response.request_id, - reference=response.token.token_reference.reference.uri, + reference=response.requested_token.token_reference.reference.uri, ), ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cepces-0.3.4/tests/cepces/__init__.py new/cepces-0.3.4/tests/cepces/__init__.py --- old/cepces-0.3.4/tests/cepces/__init__.py 2021-07-14 21:44:47.000000000 +0200 +++ new/cepces-0.3.4/tests/cepces/__init__.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,17 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of cepces. -# -# cepces is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cepces is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cepces. If not, see <http://www.gnu.org/licenses/>. -# diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cepces-0.3.4/tests/cepces/certmonger/__init__.py new/cepces-0.3.4/tests/cepces/certmonger/__init__.py --- old/cepces-0.3.4/tests/cepces/certmonger/__init__.py 2021-07-14 21:44:47.000000000 +0200 +++ new/cepces-0.3.4/tests/cepces/certmonger/__init__.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,17 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of cepces. -# -# cepces is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cepces is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cepces. If not, see <http://www.gnu.org/licenses/>. -# diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cepces-0.3.4/tests/cepces/certmonger/operation.py new/cepces-0.3.4/tests/cepces/certmonger/operation.py --- old/cepces-0.3.4/tests/cepces/certmonger/operation.py 2021-07-14 21:44:47.000000000 +0200 +++ new/cepces-0.3.4/tests/cepces/certmonger/operation.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,46 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of cepces. -# -# cepces is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cepces is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cepces. If not, see <http://www.gnu.org/licenses/>. -# -from cepces import __title__, __version__ -import unittest -import cepces.certmonger.operation as CertmongerOperations -import io - - -class TestGetDefaultTemplate(unittest.TestCase): - """Tests the GetDefaultTemplate operation""" - - def testCall(self): - out = io.StringIO() - operation = CertmongerOperations.GetDefaultTemplate(None, out=out) - operation() - - self.assertEqual(out.getvalue(), '') - - -class TestIdentify(unittest.TestCase): - """Tests the Identity operation""" - - def testCall(self): - out = io.StringIO() - operation = CertmongerOperations.Identify(None, out=out) - operation() - - self.assertEqual( - out.getvalue(), - '{} {}\n'.format(__title__, __version__), - ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cepces-0.3.4/tests/cepces/core.py new/cepces-0.3.4/tests/cepces/core.py --- old/cepces-0.3.4/tests/cepces/core.py 2021-07-14 21:44:47.000000000 +0200 +++ new/cepces-0.3.4/tests/cepces/core.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,38 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of cepces. -# -# cepces is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cepces is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cepces. If not, see <http://www.gnu.org/licenses/>. -# -import unittest -import logging -from cepces import Base - - -class TestBase(unittest.TestCase): - """Tests the Base class""" - - def testDefaultLogger(self): - """Test with default logger""" - base = Base() - - self.assertIsNotNone(base._logger) - - def testSuppliedLogger(self): - """Test with supplied logger""" - logger = logging.getLogger('Test') - base = Base(logger=logger) - - self.assertIsNotNone(base._logger) - self.assertIs(base._logger, logger) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cepces-0.3.4/tests/cepces/xcep/__init__.py new/cepces-0.3.4/tests/cepces/xcep/__init__.py --- old/cepces-0.3.4/tests/cepces/xcep/__init__.py 2021-07-14 21:44:47.000000000 +0200 +++ new/cepces-0.3.4/tests/cepces/xcep/__init__.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,17 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of cepces. -# -# cepces is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cepces is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cepces. If not, see <http://www.gnu.org/licenses/>. -# diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cepces-0.3.4/tests/cepces/xcep/converter.py new/cepces-0.3.4/tests/cepces/xcep/converter.py --- old/cepces-0.3.4/tests/cepces/xcep/converter.py 2021-07-14 21:44:47.000000000 +0200 +++ new/cepces-0.3.4/tests/cepces/xcep/converter.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,67 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of cepces. -# -# cepces is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cepces is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cepces. If not, see <http://www.gnu.org/licenses/>. -# -from unittest import TestCase -import cepces.xcep.converter as converter - - -class TestClientAuthenticationConverter(TestCase): - def testFromNone(self): - """None as input should return None""" - input = None - c = converter.ClientAuthenticationConverter - - self.assertIsNone(c.from_string(input)) - - def testFromString(self): - """Valid input integer strings should return the correct string""" - c = converter.ClientAuthenticationConverter - - for i in range(len(converter.ClientAuthenticationConverter.MAP)): - result = c.from_string(str(1 << i)) - - self.assertEqual( - converter.ClientAuthenticationConverter.MAP[i][1], - result, - msg="{} should return {}".format( - str(i), - converter.ClientAuthenticationConverter.MAP[i][1], - ), - ) - self.assertIs( - type(result), - str, - msg="{} should be of type str".format(str(i)), - ) - - def testToNone(self): - """None as input should return None""" - input = None - result = converter.IntegerConverter.to_string(input) - - self.assertIsNone(result) - - def testToString(self): - """A valid string should yield the correct stringified integer""" - c = converter.ClientAuthenticationConverter - - for i in range(len(converter.ClientAuthenticationConverter.MAP)): - value = converter.ClientAuthenticationConverter.MAP[i] - result = c.to_string(value[1]) - - self.assertEqual(type(result), str) - self.assertEqual(result, str(value[0])) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cepces-0.3.4/tests/cepces/xml/__init__.py new/cepces-0.3.4/tests/cepces/xml/__init__.py --- old/cepces-0.3.4/tests/cepces/xml/__init__.py 2021-07-14 21:44:47.000000000 +0200 +++ new/cepces-0.3.4/tests/cepces/xml/__init__.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,17 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of cepces. -# -# cepces is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cepces is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cepces. If not, see <http://www.gnu.org/licenses/>. -# diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cepces-0.3.4/tests/cepces/xml/binding.py new/cepces-0.3.4/tests/cepces/xml/binding.py --- old/cepces-0.3.4/tests/cepces/xml/binding.py 2021-07-14 21:44:47.000000000 +0200 +++ new/cepces-0.3.4/tests/cepces/xml/binding.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,96 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of cepces. -# -# cepces is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cepces is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cepces. If not, see <http://www.gnu.org/licenses/>. -# -import unittest -from cepces.xml.binding import ListingMeta -from cepces.xml.binding import XMLDescriptor - - -class MockXMLDescriptor(XMLDescriptor): - def __get__(self, instance, _owner=None): - return instance._test_value - - def __set__(self, instance, value): - instance._test_value = value - - def __delete__(self, instance): - pass - - -class TestXMLDescriptor(unittest.TestCase): - def testOnlyName(self): - """Qualified name should be equal to name""" - descriptor = MockXMLDescriptor('name') - - self.assertEqual(descriptor._name, 'name') - self.assertEqual(descriptor._namespace, None) - self.assertEqual(descriptor._qname, 'name') - - def testNameAndNameSpace(self): - """Qualified name should be in Clark's notation""" - descriptor = MockXMLDescriptor('name', 'namespace') - - self.assertEqual(descriptor._name, 'name') - self.assertEqual(descriptor._namespace, 'namespace') - self.assertEqual(descriptor._qname, '{namespace}name') - - def testIndexIncrement(self): - """Static index should increase accordingly""" - index = XMLDescriptor._index - - # Create three descriptors.. - first = MockXMLDescriptor('first') - second = MockXMLDescriptor('second') - third = MockXMLDescriptor('third') - - self.assertEqual(first._index, index) - self.assertEqual(second._index, index + 1) - self.assertEqual(third._index, index + 2) - self.assertEqual(XMLDescriptor._index, index + 3) - - -class TestListingMeta(unittest.TestCase): - def setUp(self): - super().setUp() - - # Create a dummy class. - class MockClass(metaclass=ListingMeta): - first = MockXMLDescriptor('first') - second = MockXMLDescriptor('second') - third = MockXMLDescriptor('third') - - self._dummy = MockClass - - def testListingAttribute(self): - self.assertTrue(hasattr(self._dummy, '__listing__')) - - def testOrderedListing(self): - dummy = self._dummy - listing = dummy.__listing__ - - self.assertEqual(listing[0][0], 'first') - self.assertEqual(listing[1][0], 'second') - self.assertEqual(listing[2][0], 'third') - - self.assertEqual(listing[0][1], dummy.__dict__[listing[0][0]]) - self.assertEqual(listing[1][1], dummy.__dict__[listing[1][0]]) - self.assertEqual(listing[2][1], dummy.__dict__[listing[2][0]]) - - def tearDown(self): - super().tearDown() - - self._dummy = None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cepces-0.3.4/tests/cepces/xml/converter.py new/cepces-0.3.4/tests/cepces/xml/converter.py --- old/cepces-0.3.4/tests/cepces/xml/converter.py 2021-07-14 21:44:47.000000000 +0200 +++ new/cepces-0.3.4/tests/cepces/xml/converter.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,212 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of cepces. -# -# cepces is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cepces is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cepces. If not, see <http://www.gnu.org/licenses/>. -# -from unittest import TestCase -import cepces.xml.converter as converter - - -class TestStringConverter(TestCase): - def testFromNone(self): - """None as input should return None""" - input = None - result = converter.StringConverter.from_string(input) - - self.assertIsNone(result) - - def testFromString(self): - """A string as input should return an equal string""" - input = 'TestString' - result = converter.StringConverter.from_string(input) - - self.assertEqual(input, result) - - def testToNone(self): - """None as input should return None""" - input = None - result = converter.StringConverter.to_string(input) - - self.assertIsNone(result) - - def testToString(self): - """A string as input should return an equal string""" - input = 'TestString' - result = converter.StringConverter.to_string(input) - - self.assertEqual(str(input), result) - - -class TestBooleanConverter(TestCase): - def testFromNone(self): - """None as input should return None""" - input = None - result = converter.BooleanConverter.from_string(input) - - self.assertIsNone(result) - - def testFromString(self): - """Boolean strings as input should return a boolean""" - c = converter.BooleanConverter - - self.assertEqual(True, c.from_string('true')) - self.assertEqual(True, c.from_string('1')) - self.assertEqual(False, c.from_string('false')) - self.assertEqual(False, c.from_string('0')) - - def testToNone(self): - """None as input should return None""" - input = None - result = converter.BooleanConverter.to_string(input) - - self.assertIsNone(result) - - def testToString(self): - """A boolean as input should return an equal boolean (lower) string""" - c = converter.BooleanConverter - - self.assertEqual('true', c.to_string(True)) - self.assertEqual('false', c.to_string(False)) - - -class TestIntegerConverter(TestCase): - def testFromNone(self): - """None as input should return None""" - input = None - result = converter.IntegerConverter.from_string(input) - - self.assertIsNone(result) - - def testFromString(self): - """An integer string as input should return an integer""" - input = 4711 - result = converter.IntegerConverter.from_string(str(input)) - - self.assertEqual(input, result) - - def testToNone(self): - """None as input should return None""" - input = None - result = converter.IntegerConverter.to_string(input) - - self.assertIsNone(result) - - def testToString(self): - """An integer as input should return an equal integer string""" - input = 4711 - result = converter.IntegerConverter.to_string(input) - - self.assertEqual(str(input), result) - - -class TestRangedIntegerConverter(TestCase): - def testFromNone(self): - """None as input should return None""" - input = None - result = converter.RangedIntegerConverter.from_string(input, 0, 1) - - self.assertIsNone(result) - - def testFromString(self): - """An integer string as input should return a valid integer""" - f = converter.RangedIntegerConverter.from_string - - self.assertEqual(10, f(str(10), 0, 20)) - self.assertRaises(ValueError, f, str(-1), 0, 20) - self.assertRaises(ValueError, f, str(21), 0, 20) - - def testToNone(self): - """None as input should return None""" - input = None - result = converter.RangedIntegerConverter.to_string(input, 0, 1) - - self.assertIsNone(result) - - def testToString(self): - """An integer as input should return an equal integer string""" - f = converter.RangedIntegerConverter.to_string - - self.assertEqual(str(10), f(10, 0, 20)) - self.assertRaises(ValueError, f, -1, 0, 20) - self.assertRaises(ValueError, f, 21, 0, 20) - - -class TestSignedIntegerConverter(TestCase): - def testFromNone(self): - """None as input should return None""" - input = None - result = converter.SignedIntegerConverter.from_string(input) - - self.assertIsNone(result) - - def testFromString(self): - """An integer string as input should return a valid integer""" - f = converter.SignedIntegerConverter.from_string - - self.assertEqual(10, f(str(10))) - self.assertRaises(ValueError, f, str(-2 ** 31 - 1)) - self.assertRaises(ValueError, f, str(2 ** 31)) - - def testToNone(self): - """None as input should return None""" - input = None - result = converter.SignedIntegerConverter.to_string(input) - - self.assertIsNone(result) - - def testToString(self): - """An integer as input should return an equal integer string""" - f = converter.SignedIntegerConverter.to_string - - self.assertEqual(str(10), f(10)) - self.assertRaises(ValueError, f, -2 ** 31 - 1) - self.assertRaises(ValueError, f, 2 ** 31) - - -class TestUnsignedIntegerConverter(TestCase): - def testFromNone(self): - """None as input should return None""" - input = None - result = converter.UnsignedIntegerConverter.from_string(input) - - self.assertIsNone(result) - - def testFromString(self): - """An integer string as input should return a valid integer""" - f = converter.UnsignedIntegerConverter.from_string - - self.assertEqual(10, f(str(10))) - self.assertRaises(ValueError, f, str(-1)) - self.assertRaises(ValueError, f, str(2 ** 32)) - - def testToNone(self): - """None as input should return None""" - input = None - result = converter.UnsignedIntegerConverter.to_string(input) - - self.assertIsNone(result) - - def testToString(self): - """An integer as input should return an equal integer string""" - f = converter.UnsignedIntegerConverter.to_string - - self.assertEqual(str(10), f(10)) - self.assertRaises(ValueError, f, -1) - self.assertRaises(ValueError, f, 2 ** 32) - - -class TestDateTimeConverter(TestCase): - # TODO - pass diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cepces-0.3.4/tests/cepces/xml/util.py new/cepces-0.3.4/tests/cepces/xml/util.py --- old/cepces-0.3.4/tests/cepces/xml/util.py 2021-07-14 21:44:47.000000000 +0200 +++ new/cepces-0.3.4/tests/cepces/xml/util.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,72 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of cepces. -# -# cepces is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# cepces is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with cepces. If not, see <http://www.gnu.org/licenses/>. -# -from cepces.xml import util -import unittest - - -class TestToClarkNotation(unittest.TestCase): - def testName(self): - """Name should not be changed when namespace is None""" - name = 'TestName' - - self.assertEqual(util.to_clark(name), name) - - def testNameAndNamespace(self): - """Result should follow Clarks's notation""" - name = 'TestName' - namespace = 'TestNameSpace' - - self.assertEqual( - util.to_clark(name, namespace), - '{{{1:s}}}{0:s}'.format(name, namespace) - ) - - def testNamespace(self): - """Only specifying the namespace should fail""" - namespace = 'TestNameSpace' - - with self.assertRaises(TypeError): - util.to_clark(None, namespace) - - -class TestFromClarkNotation(unittest.TestCase): - def testOnlyName(self): - """Input should be returned unaltered""" - name = 'TestName' - rname, rnamespace = util.from_clark(name) - - self.assertEqual(rname, name) - self.assertEqual(rnamespace, None) - - def testNameAndNamespace(self): - """(name, namsepace) tuple should be returned""" - name = 'TestName' - namespace = 'TestNamespace' - - clarke = util.to_clark(name, namespace) - rname, rnamespace = util.from_clark(clarke) - - self.assertEqual(name, rname) - self.assertEqual(namespace, rnamespace) - - def testOnlyNamespace(self): - """Having only a namespace should fail""" - string = '{TestNamespace}' - - with self.assertRaises(ValueError): - util.from_clark(string) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cepces-0.3.4/tests/cepces_test/__init__.py new/cepces-0.3.4/tests/cepces_test/__init__.py --- old/cepces-0.3.4/tests/cepces_test/__init__.py 1970-01-01 01:00:00.000000000 +0100 +++ new/cepces-0.3.4/tests/cepces_test/__init__.py 2021-07-19 16:14:02.000000000 +0200 @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# +# This file is part of cepces. +# +# cepces is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cepces is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cepces. If not, see <http://www.gnu.org/licenses/>. +# +from .certmonger import * +from .xcep import * +from .xml import * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cepces-0.3.4/tests/cepces_test/certmonger/__init__.py new/cepces-0.3.4/tests/cepces_test/certmonger/__init__.py --- old/cepces-0.3.4/tests/cepces_test/certmonger/__init__.py 1970-01-01 01:00:00.000000000 +0100 +++ new/cepces-0.3.4/tests/cepces_test/certmonger/__init__.py 2021-07-19 16:14:02.000000000 +0200 @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# +# This file is part of cepces. +# +# cepces is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cepces is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cepces. If not, see <http://www.gnu.org/licenses/>. +# +from .operation import * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cepces-0.3.4/tests/cepces_test/certmonger/operation.py new/cepces-0.3.4/tests/cepces_test/certmonger/operation.py --- old/cepces-0.3.4/tests/cepces_test/certmonger/operation.py 1970-01-01 01:00:00.000000000 +0100 +++ new/cepces-0.3.4/tests/cepces_test/certmonger/operation.py 2021-07-19 16:14:02.000000000 +0200 @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# +# This file is part of cepces. +# +# cepces is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cepces is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cepces. If not, see <http://www.gnu.org/licenses/>. +# +from cepces import __title__, __version__ +import unittest +import cepces.certmonger.operation as CertmongerOperations +import io + + +class TestGetDefaultTemplate(unittest.TestCase): + """Tests the GetDefaultTemplate operation""" + + def testCall(self): + out = io.StringIO() + operation = CertmongerOperations.GetDefaultTemplate(None, out=out) + operation() + + self.assertEqual(out.getvalue(), '') + + +class TestIdentify(unittest.TestCase): + """Tests the Identity operation""" + + def testCall(self): + out = io.StringIO() + operation = CertmongerOperations.Identify(None, out=out) + operation() + + self.assertEqual( + out.getvalue(), + '{} {}\n'.format(__title__, __version__), + ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cepces-0.3.4/tests/cepces_test/core.py new/cepces-0.3.4/tests/cepces_test/core.py --- old/cepces-0.3.4/tests/cepces_test/core.py 1970-01-01 01:00:00.000000000 +0100 +++ new/cepces-0.3.4/tests/cepces_test/core.py 2021-07-19 16:14:02.000000000 +0200 @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# +# This file is part of cepces. +# +# cepces is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cepces is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cepces. If not, see <http://www.gnu.org/licenses/>. +# +import unittest +import logging +from cepces import Base + + +class TestBase(unittest.TestCase): + """Tests the Base class""" + + def testDefaultLogger(self): + """Test with default logger""" + base = Base() + + self.assertIsNotNone(base._logger) + + def testSuppliedLogger(self): + """Test with supplied logger""" + logger = logging.getLogger('Test') + base = Base(logger=logger) + + self.assertIsNotNone(base._logger) + self.assertIs(base._logger, logger) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cepces-0.3.4/tests/cepces_test/xcep/__init__.py new/cepces-0.3.4/tests/cepces_test/xcep/__init__.py --- old/cepces-0.3.4/tests/cepces_test/xcep/__init__.py 1970-01-01 01:00:00.000000000 +0100 +++ new/cepces-0.3.4/tests/cepces_test/xcep/__init__.py 2021-07-19 16:14:02.000000000 +0200 @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# +# This file is part of cepces. +# +# cepces is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cepces is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cepces. If not, see <http://www.gnu.org/licenses/>. +# +from .converter import * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cepces-0.3.4/tests/cepces_test/xcep/converter.py new/cepces-0.3.4/tests/cepces_test/xcep/converter.py --- old/cepces-0.3.4/tests/cepces_test/xcep/converter.py 1970-01-01 01:00:00.000000000 +0100 +++ new/cepces-0.3.4/tests/cepces_test/xcep/converter.py 2021-07-19 16:14:02.000000000 +0200 @@ -0,0 +1,67 @@ +# -*- coding: utf-8 -*- +# +# This file is part of cepces. +# +# cepces is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cepces is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cepces. If not, see <http://www.gnu.org/licenses/>. +# +from unittest import TestCase +import cepces.xcep.converter as converter + + +class TestClientAuthenticationConverter(TestCase): + def testFromNone(self): + """None as input should return None""" + input = None + c = converter.ClientAuthenticationConverter + + self.assertIsNone(c.from_string(input)) + + def testFromString(self): + """Valid input integer strings should return the correct string""" + c = converter.ClientAuthenticationConverter + + for i in range(len(converter.ClientAuthenticationConverter.MAP)): + result = c.from_string(str(1 << i)) + + self.assertEqual( + converter.ClientAuthenticationConverter.MAP[i][1], + result, + msg="{} should return {}".format( + str(i), + converter.ClientAuthenticationConverter.MAP[i][1], + ), + ) + self.assertIs( + type(result), + str, + msg="{} should be of type str".format(str(i)), + ) + + def testToNone(self): + """None as input should return None""" + input = None + result = converter.IntegerConverter.to_string(input) + + self.assertIsNone(result) + + def testToString(self): + """A valid string should yield the correct stringified integer""" + c = converter.ClientAuthenticationConverter + + for i in range(len(converter.ClientAuthenticationConverter.MAP)): + value = converter.ClientAuthenticationConverter.MAP[i] + result = c.to_string(value[1]) + + self.assertEqual(type(result), str) + self.assertEqual(result, str(value[0])) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cepces-0.3.4/tests/cepces_test/xml/__init__.py new/cepces-0.3.4/tests/cepces_test/xml/__init__.py --- old/cepces-0.3.4/tests/cepces_test/xml/__init__.py 1970-01-01 01:00:00.000000000 +0100 +++ new/cepces-0.3.4/tests/cepces_test/xml/__init__.py 2021-07-19 16:14:02.000000000 +0200 @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# +# This file is part of cepces. +# +# cepces is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cepces is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cepces. If not, see <http://www.gnu.org/licenses/>. +# +from .binding import * +from .converter import * +from .util import * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cepces-0.3.4/tests/cepces_test/xml/binding.py new/cepces-0.3.4/tests/cepces_test/xml/binding.py --- old/cepces-0.3.4/tests/cepces_test/xml/binding.py 1970-01-01 01:00:00.000000000 +0100 +++ new/cepces-0.3.4/tests/cepces_test/xml/binding.py 2021-07-19 16:14:02.000000000 +0200 @@ -0,0 +1,96 @@ +# -*- coding: utf-8 -*- +# +# This file is part of cepces. +# +# cepces is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cepces is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cepces. If not, see <http://www.gnu.org/licenses/>. +# +import unittest +from cepces.xml.binding import ListingMeta +from cepces.xml.binding import XMLDescriptor + + +class MockXMLDescriptor(XMLDescriptor): + def __get__(self, instance, _owner=None): + return instance._test_value + + def __set__(self, instance, value): + instance._test_value = value + + def __delete__(self, instance): + pass + + +class TestXMLDescriptor(unittest.TestCase): + def testOnlyName(self): + """Qualified name should be equal to name""" + descriptor = MockXMLDescriptor('name') + + self.assertEqual(descriptor._name, 'name') + self.assertEqual(descriptor._namespace, None) + self.assertEqual(descriptor._qname, 'name') + + def testNameAndNameSpace(self): + """Qualified name should be in Clark's notation""" + descriptor = MockXMLDescriptor('name', 'namespace') + + self.assertEqual(descriptor._name, 'name') + self.assertEqual(descriptor._namespace, 'namespace') + self.assertEqual(descriptor._qname, '{namespace}name') + + def testIndexIncrement(self): + """Static index should increase accordingly""" + index = XMLDescriptor._index + + # Create three descriptors.. + first = MockXMLDescriptor('first') + second = MockXMLDescriptor('second') + third = MockXMLDescriptor('third') + + self.assertEqual(first._index, index) + self.assertEqual(second._index, index + 1) + self.assertEqual(third._index, index + 2) + self.assertEqual(XMLDescriptor._index, index + 3) + + +class TestListingMeta(unittest.TestCase): + def setUp(self): + super().setUp() + + # Create a dummy class. + class MockClass(metaclass=ListingMeta): + first = MockXMLDescriptor('first') + second = MockXMLDescriptor('second') + third = MockXMLDescriptor('third') + + self._dummy = MockClass + + def testListingAttribute(self): + self.assertTrue(hasattr(self._dummy, '__listing__')) + + def testOrderedListing(self): + dummy = self._dummy + listing = dummy.__listing__ + + self.assertEqual(listing[0][0], 'first') + self.assertEqual(listing[1][0], 'second') + self.assertEqual(listing[2][0], 'third') + + self.assertEqual(listing[0][1], dummy.__dict__[listing[0][0]]) + self.assertEqual(listing[1][1], dummy.__dict__[listing[1][0]]) + self.assertEqual(listing[2][1], dummy.__dict__[listing[2][0]]) + + def tearDown(self): + super().tearDown() + + self._dummy = None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cepces-0.3.4/tests/cepces_test/xml/converter.py new/cepces-0.3.4/tests/cepces_test/xml/converter.py --- old/cepces-0.3.4/tests/cepces_test/xml/converter.py 1970-01-01 01:00:00.000000000 +0100 +++ new/cepces-0.3.4/tests/cepces_test/xml/converter.py 2021-07-19 16:14:02.000000000 +0200 @@ -0,0 +1,212 @@ +# -*- coding: utf-8 -*- +# +# This file is part of cepces. +# +# cepces is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cepces is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cepces. If not, see <http://www.gnu.org/licenses/>. +# +from unittest import TestCase +import cepces.xml.converter as converter + + +class TestStringConverter(TestCase): + def testFromNone(self): + """None as input should return None""" + input = None + result = converter.StringConverter.from_string(input) + + self.assertIsNone(result) + + def testFromString(self): + """A string as input should return an equal string""" + input = 'TestString' + result = converter.StringConverter.from_string(input) + + self.assertEqual(input, result) + + def testToNone(self): + """None as input should return None""" + input = None + result = converter.StringConverter.to_string(input) + + self.assertIsNone(result) + + def testToString(self): + """A string as input should return an equal string""" + input = 'TestString' + result = converter.StringConverter.to_string(input) + + self.assertEqual(str(input), result) + + +class TestBooleanConverter(TestCase): + def testFromNone(self): + """None as input should return None""" + input = None + result = converter.BooleanConverter.from_string(input) + + self.assertIsNone(result) + + def testFromString(self): + """Boolean strings as input should return a boolean""" + c = converter.BooleanConverter + + self.assertEqual(True, c.from_string('true')) + self.assertEqual(True, c.from_string('1')) + self.assertEqual(False, c.from_string('false')) + self.assertEqual(False, c.from_string('0')) + + def testToNone(self): + """None as input should return None""" + input = None + result = converter.BooleanConverter.to_string(input) + + self.assertIsNone(result) + + def testToString(self): + """A boolean as input should return an equal boolean (lower) string""" + c = converter.BooleanConverter + + self.assertEqual('true', c.to_string(True)) + self.assertEqual('false', c.to_string(False)) + + +class TestIntegerConverter(TestCase): + def testFromNone(self): + """None as input should return None""" + input = None + result = converter.IntegerConverter.from_string(input) + + self.assertIsNone(result) + + def testFromString(self): + """An integer string as input should return an integer""" + input = 4711 + result = converter.IntegerConverter.from_string(str(input)) + + self.assertEqual(input, result) + + def testToNone(self): + """None as input should return None""" + input = None + result = converter.IntegerConverter.to_string(input) + + self.assertIsNone(result) + + def testToString(self): + """An integer as input should return an equal integer string""" + input = 4711 + result = converter.IntegerConverter.to_string(input) + + self.assertEqual(str(input), result) + + +class TestRangedIntegerConverter(TestCase): + def testFromNone(self): + """None as input should return None""" + input = None + result = converter.RangedIntegerConverter.from_string(input, 0, 1) + + self.assertIsNone(result) + + def testFromString(self): + """An integer string as input should return a valid integer""" + f = converter.RangedIntegerConverter.from_string + + self.assertEqual(10, f(str(10), 0, 20)) + self.assertRaises(ValueError, f, str(-1), 0, 20) + self.assertRaises(ValueError, f, str(21), 0, 20) + + def testToNone(self): + """None as input should return None""" + input = None + result = converter.RangedIntegerConverter.to_string(input, 0, 1) + + self.assertIsNone(result) + + def testToString(self): + """An integer as input should return an equal integer string""" + f = converter.RangedIntegerConverter.to_string + + self.assertEqual(str(10), f(10, 0, 20)) + self.assertRaises(ValueError, f, -1, 0, 20) + self.assertRaises(ValueError, f, 21, 0, 20) + + +class TestSignedIntegerConverter(TestCase): + def testFromNone(self): + """None as input should return None""" + input = None + result = converter.SignedIntegerConverter.from_string(input) + + self.assertIsNone(result) + + def testFromString(self): + """An integer string as input should return a valid integer""" + f = converter.SignedIntegerConverter.from_string + + self.assertEqual(10, f(str(10))) + self.assertRaises(ValueError, f, str(-2 ** 31 - 1)) + self.assertRaises(ValueError, f, str(2 ** 31)) + + def testToNone(self): + """None as input should return None""" + input = None + result = converter.SignedIntegerConverter.to_string(input) + + self.assertIsNone(result) + + def testToString(self): + """An integer as input should return an equal integer string""" + f = converter.SignedIntegerConverter.to_string + + self.assertEqual(str(10), f(10)) + self.assertRaises(ValueError, f, -2 ** 31 - 1) + self.assertRaises(ValueError, f, 2 ** 31) + + +class TestUnsignedIntegerConverter(TestCase): + def testFromNone(self): + """None as input should return None""" + input = None + result = converter.UnsignedIntegerConverter.from_string(input) + + self.assertIsNone(result) + + def testFromString(self): + """An integer string as input should return a valid integer""" + f = converter.UnsignedIntegerConverter.from_string + + self.assertEqual(10, f(str(10))) + self.assertRaises(ValueError, f, str(-1)) + self.assertRaises(ValueError, f, str(2 ** 32)) + + def testToNone(self): + """None as input should return None""" + input = None + result = converter.UnsignedIntegerConverter.to_string(input) + + self.assertIsNone(result) + + def testToString(self): + """An integer as input should return an equal integer string""" + f = converter.UnsignedIntegerConverter.to_string + + self.assertEqual(str(10), f(10)) + self.assertRaises(ValueError, f, -1) + self.assertRaises(ValueError, f, 2 ** 32) + + +class TestDateTimeConverter(TestCase): + # TODO + pass diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cepces-0.3.4/tests/cepces_test/xml/util.py new/cepces-0.3.4/tests/cepces_test/xml/util.py --- old/cepces-0.3.4/tests/cepces_test/xml/util.py 1970-01-01 01:00:00.000000000 +0100 +++ new/cepces-0.3.4/tests/cepces_test/xml/util.py 2021-07-19 16:14:02.000000000 +0200 @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- +# +# This file is part of cepces. +# +# cepces is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cepces is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cepces. If not, see <http://www.gnu.org/licenses/>. +# +from cepces.xml import util +import unittest + + +class TestToClarkNotation(unittest.TestCase): + def testName(self): + """Name should not be changed when namespace is None""" + name = 'TestName' + + self.assertEqual(util.to_clark(name), name) + + def testNameAndNamespace(self): + """Result should follow Clarks's notation""" + name = 'TestName' + namespace = 'TestNameSpace' + + self.assertEqual( + util.to_clark(name, namespace), + '{{{1:s}}}{0:s}'.format(name, namespace) + ) + + def testNamespace(self): + """Only specifying the namespace should fail""" + namespace = 'TestNameSpace' + + with self.assertRaises(TypeError): + util.to_clark(None, namespace) + + +class TestFromClarkNotation(unittest.TestCase): + def testOnlyName(self): + """Input should be returned unaltered""" + name = 'TestName' + rname, rnamespace = util.from_clark(name) + + self.assertEqual(rname, name) + self.assertEqual(rnamespace, None) + + def testNameAndNamespace(self): + """(name, namsepace) tuple should be returned""" + name = 'TestName' + namespace = 'TestNamespace' + + clarke = util.to_clark(name, namespace) + rname, rnamespace = util.from_clark(clarke) + + self.assertEqual(name, rname) + self.assertEqual(namespace, rnamespace) + + def testOnlyNamespace(self): + """Having only a namespace should fail""" + string = '{TestNamespace}' + + with self.assertRaises(ValueError): + util.from_clark(string) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cepces-0.3.4/tests/runner.py new/cepces-0.3.4/tests/runner.py --- old/cepces-0.3.4/tests/runner.py 1970-01-01 01:00:00.000000000 +0100 +++ new/cepces-0.3.4/tests/runner.py 2021-07-19 16:14:02.000000000 +0200 @@ -0,0 +1,16 @@ +#!/usr/bin/python3 +import unittest +import sys +sys.path.insert(0, '../') +import cepces_test + +if __name__ == "__main__": + loader = unittest.TestLoader() + suite = unittest.TestSuite() + + suite.addTests(loader.loadTestsFromModule(cepces_test.certmonger)) + suite.addTests(loader.loadTestsFromModule(cepces_test.xcep)) + suite.addTests(loader.loadTestsFromModule(cepces_test.xml)) + + runner = unittest.TextTestRunner(verbosity=3, failfast=True) + runner.run(suite)