diff options
author | 2020-07-27 15:22:44 -0500 | |
---|---|---|
committer | 2020-08-05 04:41:34 +0000 | |
commit | aa7b6cafbab7839dc371bd48d4c1b44f32ce5c87 (patch) | |
tree | 7149366a336888064404466dbb66c4c9ce11dd40 /dev-python/configobj/files/configobj-5.0.6-fix-py2-tests.patch | |
parent | dev-libs/jsoncpp: Stabilize 1.9.3 arm, #734538 (diff) | |
download | gentoo-aa7b6cafbab7839dc371bd48d4c1b44f32ce5c87.tar.gz gentoo-aa7b6cafbab7839dc371bd48d4c1b44f32ce5c87.tar.bz2 gentoo-aa7b6cafbab7839dc371bd48d4c1b44f32ce5c87.zip |
dev-python/configobj: Various fixes
Switch SRC_URI to Github release tarball, add patch to fix tests on arm,
EAPI bump, add DISTUTILS_USE_SETUPTOOLS=no like the eclass suggests.
Closes: https://bugs.gentoo.org/732092
Package-Manager: Portage-3.0.1, Repoman-2.3.23
Signed-off-by: John Helmert III <jchelmert3@posteo.net>
Closes: https://github.com/gentoo/gentoo/pull/16865
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-python/configobj/files/configobj-5.0.6-fix-py2-tests.patch')
-rw-r--r-- | dev-python/configobj/files/configobj-5.0.6-fix-py2-tests.patch | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/dev-python/configobj/files/configobj-5.0.6-fix-py2-tests.patch b/dev-python/configobj/files/configobj-5.0.6-fix-py2-tests.patch new file mode 100644 index 00000000000..5ac64a256cb --- /dev/null +++ b/dev-python/configobj/files/configobj-5.0.6-fix-py2-tests.patch @@ -0,0 +1,55 @@ +Upstream: https://github.com/DiffSK/configobj/commit/e2731538d1a37a5b67a6e518848be6a8988043ae + +diff --git a/tests/test_validate.py b/tests/test_validate.py +index bffb0dc..4eed7e9 100644 +--- a/tests/test_validate.py ++++ b/tests/test_validate.py +@@ -161,3 +161,26 @@ class TestBasic(object): + 'test3': 3, + 'test4': 6.0 + }}} ++ ++ ++class TestDottedQuadToNum(object): ++ ++ def test_stripped(self): ++ assert dottedQuadToNum('192.0.2.0') == 3221225984 ++ assert dottedQuadToNum('192.0.2.1 ') == 3221225985 ++ assert dottedQuadToNum(' 192.0.2.2') == 3221225986 ++ assert dottedQuadToNum('\t\t192.0.2.3\n') == 3221225987 ++ with pytest.raises(ValueError) as excinfo: ++ dottedQuadToNum('192. 0. 2. 4') ++ assert str(excinfo.value) == 'Not a good dotted-quad IP: 192. 0. 2. 4' ++ ++ def test_boundaries(self): ++ assert dottedQuadToNum('0.0.0.0') == 0 ++ assert dottedQuadToNum('255.255.255.255') == 4294967295 ++ with pytest.raises(ValueError) as excinfo: ++ dottedQuadToNum('255.255.255.256') ++ assert str(excinfo.value) == ( ++ 'Not a good dotted-quad IP: 255.255.255.256') ++ with pytest.raises(ValueError) as excinfo: ++ dottedQuadToNum('-1') ++ assert str(excinfo.value) == 'Not a good dotted-quad IP: -1' +diff --git a/validate.py b/validate.py +index b7a964c..9d8c94d 100644 +--- a/validate.py ++++ b/validate.py +@@ -277,17 +277,8 @@ def dottedQuadToNum(ip): + + >>> int(dottedQuadToNum('1 ')) + 1 +- >>> int(dottedQuadToNum(' 1.2')) +- 16777218 +- >>> int(dottedQuadToNum(' 1.2.3 ')) +- 16908291 + >>> int(dottedQuadToNum('1.2.3.4')) + 16909060 +- >>> dottedQuadToNum('255.255.255.255') +- 4294967295 +- >>> dottedQuadToNum('255.255.255.256') +- Traceback (most recent call last): +- ValueError: Not a good dotted-quad IP: 255.255.255.256 + """ + + # import here to avoid it when ip_addr values are not used |