From 880828ff0de6d057ce3bec531cc80c1f3c032b4a Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Sat, 6 Feb 2016 12:27:15 +0000 Subject: [PATCH] Fix fix-python3.5-unit-tests.patch --- debian/patches/fix-python3.5-unit-tests.patch | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/debian/patches/fix-python3.5-unit-tests.patch b/debian/patches/fix-python3.5-unit-tests.patch index 184c2a9..e1e1277 100644 --- a/debian/patches/fix-python3.5-unit-tests.patch +++ b/debian/patches/fix-python3.5-unit-tests.patch @@ -5,12 +5,15 @@ Last-Update: 2016-02-06 --- python-cliff-1.15.0.orig/cliff/tests/test_formatters_csv.py +++ python-cliff-1.15.0/cliff/tests/test_formatters_csv.py -@@ -14,11 +14,12 @@ def test_commaseparated_list_formatter() +@@ -14,11 +14,15 @@ def test_commaseparated_list_formatter() d2 = ('D', 'E', 'F') data = [d1, d2] expected = 'a,b,c\nA,B,C\nD,E,F\n' - output = six.StringIO() -+ output = six.BytesIO() ++ if six.PY2 or sys.version_info >= (3, 5): ++ output = six.BytesIO() ++ else: ++ output = six.StringIO() parsed_args = mock.Mock() parsed_args.quote_mode = 'none' sf.emit_list(c, data, output, parsed_args) @@ -19,19 +22,21 @@ Last-Update: 2016-02-06 assert expected == actual -@@ -30,11 +31,11 @@ def test_commaseparated_list_formatter_u +@@ -30,11 +34,13 @@ def test_commaseparated_list_formatter_u d2 = (u'D', u'E', happy) data = [d1, d2] expected = u'a,b,c\nA,B,C\nD,E,%s\n' % happy - output = six.StringIO() -+ output = six.BytesIO() ++ if six.PY2 or sys.version_info >= (3, 5): ++ output = six.BytesIO() ++ else: ++ output = six.StringIO() parsed_args = mock.Mock() parsed_args.quote_mode = 'none' sf.emit_list(c, data, output, parsed_args) actual = output.getvalue() - if six.PY2: - actual = actual.decode('utf-8') -+# if six.PY2: + actual = actual.decode('utf-8') assert expected == actual --- python-cliff-1.15.0.orig/cliff/tests/test_help.py