dev-python/webencodings: Clean old versions up

This commit is contained in:
Michał Górny
2017-05-02 18:06:50 +02:00
parent bee73f4540
commit 85f04f4269
3 changed files with 0 additions and 112 deletions

View File

@@ -1,2 +1 @@
DIST webencodings-0.4.tar.gz 9412 SHA256 3a45b2af274dabbb84eb68256bf0fb1e2e87a48ae4ad3ba4d7936cef3ce14e1d SHA512 3f46e26dd555838397a52e74304452b39fbe05032b4fed4a4f2574580bd71eac50c242aacd7ebc23ecb860d4ea6e0690b7a7ea4cc974382a4a1303a36f8ffd46 WHIRLPOOL 623c83aa106ae251100d995c632f1ddcb5b4b46fd1bc03b7565c69ad6f5f918d81039ccc7bd8048beef1e87a4aed643bfe4f045839b12ad00f0e232933b57a2c
DIST webencodings-0.5.tar.gz 9479 SHA256 a5c55ee93b24e740fe951c37b5c228dccc1f171450e188555a775261cce1b904 SHA512 3f0c1995d23a8ccf8f0b02301edec5834336c27b7daf2335ded888073a1f13058acd93477cd020bb2b12d51b393d9b3166acf4995564cb9751ace8df35a891c2 WHIRLPOOL 72865b86c152e6a43ab1c64e127055629dbfc8419e46b3647c94ff75e55cad3b446bd0951979fa2b39daa847e1cf9e64b4a54ea11bc494b85c4a6b747857cdb1

View File

@@ -1,71 +0,0 @@
From 87044de0d2640cf9a8f941dec1fc79c679e7fa2d Mon Sep 17 00:00:00 2001
From: Geoffrey Sneddon <me@gsnedders.com>
Date: Sun, 17 Jan 2016 16:50:58 +0100
Subject: [PATCH] Fix #2: get tests passing again after decode API change
---
webencodings/tests.py | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/webencodings/tests.py b/webencodings/tests.py
index e0297d9..b8c5653 100644
--- a/webencodings/tests.py
+++ b/webencodings/tests.py
@@ -47,7 +47,7 @@ def test_labels():
def test_all_labels():
for label in LABELS:
- assert decode(b'', label) == ''
+ assert decode(b'', label) == ('', lookup(label))
assert encode('', label) == b''
for repeat in [0, 1, 12]:
output, _ = iter_decode([b''] * repeat, label)
@@ -74,25 +74,25 @@ def test_invalid_label():
def test_decode():
- assert decode(b'\x80', 'latin1') == '€'
- assert decode(b'\x80', lookup('latin1')) == '€'
- assert decode(b'\xc3\xa9', 'utf8') == 'é'
- assert decode(b'\xc3\xa9', UTF8) == 'é'
- assert decode(b'\xc3\xa9', 'ascii') == 'é'
- assert decode(b'\xEF\xBB\xBF\xc3\xa9', 'ascii') == 'é' # UTF-8 with BOM
+ assert decode(b'\x80', 'latin1') == ('€', lookup('latin1'))
+ assert decode(b'\x80', lookup('latin1')) == ('€', lookup('latin1'))
+ assert decode(b'\xc3\xa9', 'utf8') == ('é', lookup('utf8'))
+ assert decode(b'\xc3\xa9', UTF8) == ('é', lookup('utf8'))
+ assert decode(b'\xc3\xa9', 'ascii') == ('é', lookup('ascii'))
+ assert decode(b'\xEF\xBB\xBF\xc3\xa9', 'ascii') == ('é', lookup('utf8')) # UTF-8 with BOM
- assert decode(b'\xFE\xFF\x00\xe9', 'ascii') == 'é' # UTF-16-BE with BOM
- assert decode(b'\xFF\xFE\xe9\x00', 'ascii') == 'é' # UTF-16-LE with BOM
- assert decode(b'\xFE\xFF\xe9\x00', 'ascii') == '\ue900'
- assert decode(b'\xFF\xFE\x00\xe9', 'ascii') == '\ue900'
+ assert decode(b'\xFE\xFF\x00\xe9', 'ascii') == ('é', lookup('utf-16be')) # UTF-16-BE with BOM
+ assert decode(b'\xFF\xFE\xe9\x00', 'ascii') == ('é', lookup('utf-16le')) # UTF-16-LE with BOM
+ assert decode(b'\xFE\xFF\xe9\x00', 'ascii') == ('\ue900', lookup('utf-16be'))
+ assert decode(b'\xFF\xFE\x00\xe9', 'ascii') == ('\ue900', lookup('utf-16le'))
- assert decode(b'\x00\xe9', 'UTF-16BE') == 'é'
- assert decode(b'\xe9\x00', 'UTF-16LE') == 'é'
- assert decode(b'\xe9\x00', 'UTF-16') == 'é'
+ assert decode(b'\x00\xe9', 'UTF-16BE') == ('é', lookup('utf-16be'))
+ assert decode(b'\xe9\x00', 'UTF-16LE') == ('é', lookup('utf-16le'))
+ assert decode(b'\xe9\x00', 'UTF-16') == ('é', lookup('utf-16le'))
- assert decode(b'\xe9\x00', 'UTF-16BE') == '\ue900'
- assert decode(b'\x00\xe9', 'UTF-16LE') == '\ue900'
- assert decode(b'\x00\xe9', 'UTF-16') == '\ue900'
+ assert decode(b'\xe9\x00', 'UTF-16BE') == ('\ue900', lookup('utf-16be'))
+ assert decode(b'\x00\xe9', 'UTF-16LE') == ('\ue900', lookup('utf-16le'))
+ assert decode(b'\x00\xe9', 'UTF-16') == ('\ue900', lookup('utf-16le'))
def test_encode():
@@ -149,5 +149,5 @@ def test_x_user_defined():
decoded = '2,\x0c\x0b\x1aO\uf7d9#\uf7cb\x0f\uf7c9\uf7bbt\uf7cf\uf7a8\uf7ca'
encoded = b'aa'
decoded = 'aa'
- assert decode(encoded, 'x-user-defined') == decoded
+ assert decode(encoded, 'x-user-defined') == (decoded, lookup('x-user-defined'))
assert encode(decoded, 'x-user-defined') == encoded

View File

@@ -1,40 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=5
PYTHON_COMPAT=( python2_7 python3_{4,5} pypy pypy3 )
inherit distutils-r1
DESCRIPTION="Character encoding aliases for legacy web content"
HOMEPAGE="https://github.com/SimonSapin/python-webencodings http://pypi.python.org/pypi/webencodings"
SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
IUSE="test"
RDEPEND=""
DEPEND="${RDEPEND}
dev-python/setuptools[${PYTHON_USEDEP}]
test? (
dev-python/pytest[${PYTHON_USEDEP}]
)"
PATCHES=(
"${FILESDIR}"/${P}-test-fix-backport.patch
)
python_prepare_all(){
cat >> setup.cfg <<- EOF
[pytest]
python_files=test*.py
EOF
distutils-r1_python_prepare_all
}
python_test() {
py.test -v -v || die
}