From e63a944aa3e341d6593942d7bd313abdc63a49bc Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Nov 18 2015 09:03:34 +0000 Subject: port tests to Python 3.5 --- diff --git a/osbs-client-3-5.patch b/osbs-client-3-5.patch new file mode 100644 index 0000000..602c677 --- /dev/null +++ b/osbs-client-3-5.patch @@ -0,0 +1,28 @@ +From 71b29148c042dfffb22fe9244bcacaccb39bb9d0 Mon Sep 17 00:00:00 2001 +From: Jiri Popelka +Date: Fri, 13 Nov 2015 13:55:06 +0100 +Subject: [PATCH] In Python 3.5 httplib status codes are of enum.IntEnum type. + +We need this to make +tests/test_core.py::TestCheckResponse::test_check_response_bad_[no]stream +PASS +--- + osbs/core.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/osbs/core.py b/osbs/core.py +index e49e95c..17ee8fb 100755 +--- a/osbs/core.py ++++ b/osbs/core.py +@@ -43,7 +43,7 @@ def check_response(response): + else: + content = ''.join(response.iter_lines()) + +- logger.error("[%s] %s", response.status_code, content) ++ logger.error("[%d] %s", response.status_code, content) + raise OsbsResponseException(message=content, status_code=response.status_code) + + +-- +2.5.0 + diff --git a/osbs-client.spec b/osbs-client.spec index 180c24a..e1dc1bc 100644 --- a/osbs-client.spec +++ b/osbs-client.spec @@ -37,6 +37,7 @@ URL: https://github.com/projectatomic/osbs-client Source0: https://github.com/projectatomic/osbs-client/archive/%{commit}/osbs-client-%{commit}.tar.gz Patch0: osbs-client-skip-tests.patch +Patch1: osbs-client-3-5.patch BuildArch: noarch @@ -121,6 +122,7 @@ This package contains osbs Python 3 bindings. %setup -qn %{name}-%{commit} %patch0 -p1 +%patch1 -p1 %if 0%{?with_python3} rm -rf %{py3dir}