Hello community,

here is the log from the commit of package python-six for openSUSE:Factory 
checked in at 2018-12-14 20:47:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-six (Old)
 and      /work/SRC/openSUSE:Factory/.python-six.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-six"

Fri Dec 14 20:47:59 2018 rev:30 rq:656810 version:1.12.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-six/python-six.changes    2018-09-05 
13:44:40.721881795 +0200
+++ /work/SRC/openSUSE:Factory/.python-six.new.28833/python-six.changes 
2018-12-14 20:47:59.969458888 +0100
@@ -1,0 +2,11 @@
+Mon Dec 10 09:20:52 CET 2018 - mc...@suse.com
+
+- Update to 0.12.0:
+    * `six.add_metaclass` now preserves `__qualname__` from the
+      original class.
+    * Add `six.ensure_binary`, `six.ensure_text`, and
+      `six.ensure_str`.
+- Because of cyclical dependencies between six and Sphinx, we
+  need to to do multibuild.
+
+-------------------------------------------------------------------

Old:
----
  python-six-doc.changes
  python-six-doc.spec
  six-1.11.0.tar.gz

New:
----
  _multibuild
  six-1.12.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-six.spec ++++++
--- /var/tmp/diff_new_pack.oJNvib/_old  2018-12-14 20:48:00.673457919 +0100
+++ /var/tmp/diff_new_pack.oJNvib/_new  2018-12-14 20:48:00.677457913 +0100
@@ -17,16 +17,36 @@
 
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
+# This is not only because of dependency of testsuite, but mostly
+# because of cyclical dependencies between six and Sphinx.
+%global flavor @BUILD_FLAVOR@%{nil}
+%if "%{flavor}" == "test"
+%define test 1
+%bcond_without test
+%else
+%bcond_with test
+%endif
+%if %{with test}
+Name:           python-six-%{flavor}
+%else
 Name:           python-six
-Version:        1.11.0
+%endif
+Version:        1.12.0
 Release:        0
 Summary:        Python 2 and 3 compatibility utilities
 License:        MIT
 Group:          Development/Libraries/Python
 URL:            http://pypi.python.org/pypi/six/
 Source:         
https://files.pythonhosted.org/packages/source/s/six/six-%{version}.tar.gz
-BuildRequires:  %{python_module base}
+BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
+BuildRequires:  python2
+BuildRequires:  python3
+%if %{with test}
+BuildRequires:  %{python_module pytest}
+BuildRequires:  %{python_module py}
+BuildRequires:  python3-Sphinx
+%endif
 BuildArch:      noarch
 %python_subpackages
 
@@ -37,20 +57,45 @@
 both Python versions. See the documentation for more information on
 what is provided.
 
+%package -n python-six-doc
+Provides:       %{python_module six-doc = %{version}}
+Summary:        Documentation files for %name
+Group:          Documentation/HTML
+
+%description -n python-six-doc
+Six is a Python 2 and 3 compatibility library. It provides utility
+functions for smoothing over the differences between the Python
+versions with the goal of writing Python code that is compatible on
+both Python versions.
+
+This package provides documentation for %{name}.
+
+
 %prep
 %setup -q -n six-%{version}
 
 %build
+%if ! %{with test}
 %python_build
-# due to cyclic requirements between Sphinx and six,
-# documentation is build in its own package <h...@urpla.net>
+%else
+cd documentation && make html && rm _build/html/.buildinfo
+%endif
 
 %install
+%if ! %{with test}
 %python_install
+%python_expand %fdupes %{buildroot}%{$python_sitelib}
+%endif
 
-# Run tests in -doc package to avoid dependency loop
-# %check
-# python test_six.py
+%check
+%if %{with test}
+mkdir test
+cp test_six.py test
+pushd test
+%python_exec %{_bindir}/py.test test_six.py
+popd
+rm -rf test
+%endif
 
 %pretrans
 # bsc#1057496 - egg-info changed from directory to file
@@ -61,8 +106,12 @@
 %files %{python_files}
 %license LICENSE
 %doc README.rst CHANGES
+%if %{with test}
+%doc documentation/_build/html
+%else
 %{python_sitelib}/six.py*
 %pycache_only %{python3_sitelib}/__pycache__/*
 %{python_sitelib}/six-%{version}-py*.egg-info
+%endif
 
 %changelog

++++++ _multibuild ++++++
<multibuild>
  <package>test</package>
</multibuild>
++++++ six-1.11.0.tar.gz -> six-1.12.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/six-1.11.0/CHANGES new/six-1.12.0/CHANGES
--- old/six-1.11.0/CHANGES      2017-09-17 20:46:32.000000000 +0200
+++ new/six-1.12.0/CHANGES      2018-12-10 01:59:34.000000000 +0100
@@ -3,6 +3,15 @@
 
 This file lists the changes in each six version.
 
+1.12.0
+------
+
+- Issue #259, pull request #260: `six.add_metaclass` now preserves
+  `__qualname__` from the original class.
+
+- Pull request #204: Add `six.ensure_binary`, `six.ensure_text`, and
+  `six.ensure_str`.
+
 1.11.0
 ------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/six-1.11.0/LICENSE new/six-1.12.0/LICENSE
--- old/six-1.11.0/LICENSE      2017-09-17 20:46:32.000000000 +0200
+++ new/six-1.12.0/LICENSE      2018-12-10 01:59:34.000000000 +0100
@@ -1,4 +1,4 @@
-Copyright (c) 2010-2017 Benjamin Peterson
+Copyright (c) 2010-2018 Benjamin Peterson
 
 Permission is hereby granted, free of charge, to any person obtaining a copy of
 this software and associated documentation files (the "Software"), to deal in
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/six-1.11.0/PKG-INFO new/six-1.12.0/PKG-INFO
--- old/six-1.11.0/PKG-INFO     2017-09-17 20:46:53.000000000 +0200
+++ new/six-1.12.0/PKG-INFO     2018-12-10 01:59:56.000000000 +0100
@@ -1,19 +1,26 @@
-Metadata-Version: 1.1
+Metadata-Version: 1.2
 Name: six
-Version: 1.11.0
+Version: 1.12.0
 Summary: Python 2 and 3 compatibility utilities
-Home-page: http://pypi.python.org/pypi/six/
+Home-page: https://github.com/benjaminp/six
 Author: Benjamin Peterson
 Author-email: benja...@python.org
 License: MIT
-Description: .. image:: http://img.shields.io/pypi/v/six.svg
-           :target: https://pypi.python.org/pypi/six
+Description: .. image:: https://img.shields.io/pypi/v/six.svg
+           :target: https://pypi.org/project/six/
+           :alt: six on PyPI
         
         .. image:: https://travis-ci.org/benjaminp/six.svg?branch=master
-            :target: https://travis-ci.org/benjaminp/six
+           :target: https://travis-ci.org/benjaminp/six
+           :alt: six on TravisCI
         
-        .. image:: http://img.shields.io/badge/license-MIT-green.svg
+        .. image:: https://readthedocs.org/projects/six/badge/?version=latest
+           :target: https://six.readthedocs.io/
+           :alt: six's documentation on Read the Docs
+        
+        .. image:: https://img.shields.io/badge/license-MIT-green.svg
            :target: https://github.com/benjaminp/six/blob/master/LICENSE
+           :alt: MIT License badge
         
         Six is a Python 2 and 3 compatibility library.  It provides utility 
functions
         for smoothing over the differences between the Python versions with 
the goal of
@@ -24,7 +31,7 @@
         file, so it can be easily copied into your project. (The copyright and 
license
         notice must be retained.)
         
-        Online documentation is at http://six.rtfd.org.
+        Online documentation is at https://six.readthedocs.io/.
         
         Bugs can be reported to https://github.com/benjaminp/six.  The code 
can also
         be found there.
@@ -33,9 +40,11 @@
         list: https://mail.python.org/mailman/listinfo/python-porting
         
 Platform: UNKNOWN
+Classifier: Development Status :: 5 - Production/Stable
 Classifier: Programming Language :: Python :: 2
 Classifier: Programming Language :: Python :: 3
 Classifier: Intended Audience :: Developers
 Classifier: License :: OSI Approved :: MIT License
 Classifier: Topic :: Software Development :: Libraries
 Classifier: Topic :: Utilities
+Requires-Python: >=2.6, !=3.0.*, !=3.1.*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/six-1.11.0/README.rst new/six-1.12.0/README.rst
--- old/six-1.11.0/README.rst   2017-09-17 20:46:32.000000000 +0200
+++ new/six-1.12.0/README.rst   2018-12-10 01:59:34.000000000 +0100
@@ -1,11 +1,18 @@
-.. image:: http://img.shields.io/pypi/v/six.svg
-   :target: https://pypi.python.org/pypi/six
+.. image:: https://img.shields.io/pypi/v/six.svg
+   :target: https://pypi.org/project/six/
+   :alt: six on PyPI
 
 .. image:: https://travis-ci.org/benjaminp/six.svg?branch=master
-    :target: https://travis-ci.org/benjaminp/six
+   :target: https://travis-ci.org/benjaminp/six
+   :alt: six on TravisCI
 
-.. image:: http://img.shields.io/badge/license-MIT-green.svg
+.. image:: https://readthedocs.org/projects/six/badge/?version=latest
+   :target: https://six.readthedocs.io/
+   :alt: six's documentation on Read the Docs
+
+.. image:: https://img.shields.io/badge/license-MIT-green.svg
    :target: https://github.com/benjaminp/six/blob/master/LICENSE
+   :alt: MIT License badge
 
 Six is a Python 2 and 3 compatibility library.  It provides utility functions
 for smoothing over the differences between the Python versions with the goal of
@@ -16,7 +23,7 @@
 file, so it can be easily copied into your project. (The copyright and license
 notice must be retained.)
 
-Online documentation is at http://six.rtfd.org.
+Online documentation is at https://six.readthedocs.io/.
 
 Bugs can be reported to https://github.com/benjaminp/six.  The code can also
 be found there.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/six-1.11.0/documentation/conf.py 
new/six-1.12.0/documentation/conf.py
--- old/six-1.11.0/documentation/conf.py        2017-09-17 20:46:32.000000000 
+0200
+++ new/six-1.12.0/documentation/conf.py        2018-12-10 01:59:34.000000000 
+0100
@@ -33,7 +33,7 @@
 
 # General information about the project.
 project = u"six"
-copyright = u"2010-2017, Benjamin Peterson"
+copyright = u"2010-2018, Benjamin Peterson"
 
 sys.path.append(os.path.abspath(os.path.join(".", "..")))
 from six import __version__ as six_version
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/six-1.11.0/documentation/index.rst 
new/six-1.12.0/documentation/index.rst
--- old/six-1.11.0/documentation/index.rst      2017-09-17 20:46:32.000000000 
+0200
+++ new/six-1.12.0/documentation/index.rst      2018-12-10 01:59:34.000000000 
+0100
@@ -13,7 +13,7 @@
 without modification.  six consists of only one Python file, so it is painless
 to copy into a project.
 
-Six can be downloaded on `PyPi <https://pypi.python.org/pypi/six/>`_.  Its bug
+Six can be downloaded on `PyPI <https://pypi.org/project/six/>`_.  Its bug
 tracker and code hosting is on `GitHub <https://github.com/benjaminp/six>`_.
 
 The name, "six", comes from the fact that 2*3 equals 6.  Why not addition?
@@ -50,8 +50,9 @@
 
 .. data:: class_types
 
-   Possible class types.  In Python 2, this encompasses old-style and new-style
-   classes.  In Python 3, this is just new-styles.
+   Possible class types.  In Python 2, this encompasses old-style
+   :data:`py2:types.ClassType` and new-style ``type`` classes.  In Python 3,
+   this is just ``type``.
 
 
 .. data:: integer_types
@@ -371,7 +372,7 @@
 .. function:: b(data)
 
    A "fake" bytes literal.  *data* should always be a normal string literal.  
In
-   Python 2, :func:`b` returns a 8-bit string.  In Python 3, *data* is encoded
+   Python 2, :func:`b` returns an 8-bit string.  In Python 3, *data* is encoded
    with the latin-1 encoding to bytes.
 
 
@@ -433,6 +434,24 @@
    a bytes object iterator in Python 3.
 
 
+.. function:: ensure_binary(s, encoding='utf-8', errors='strict')
+
+   Coerce *s* to :data:`binary_type`. *encoding*, *errors* are the same as
+   :meth:`py3:str.encode`
+
+
+.. function:: ensure_str(s, encoding='utf-8', errors='strict')
+
+   Coerce *s* to ``str``. ``encoding``, ``errors`` are the same
+   :meth:`py3:str.encode`
+
+
+.. function:: ensure_text(s, encoding='utf-8', errors='strict')
+
+   Coerce *s* to :data:`text_type`. *encoding*, *errors* are the same as
+   :meth:`py3:str.encode`
+
+
 .. data:: StringIO
 
    This is a fake file object for textual data.  It's an alias for
@@ -503,7 +522,7 @@
    from six.moves import html_parser
 
 Similarly, to get the function to reload modules, which was moved from the
-builtin module to the ``imp`` module, use::
+builtin module to the ``importlib`` module, use::
 
    from six.moves import reload_module
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/six-1.11.0/setup.cfg new/six-1.12.0/setup.cfg
--- old/six-1.11.0/setup.cfg    2017-09-17 20:46:53.000000000 +0200
+++ new/six-1.12.0/setup.cfg    2018-12-10 01:59:56.000000000 +0100
@@ -5,6 +5,9 @@
 max-line-length = 100
 ignore = F821
 
+[metadata]
+license_file = LICENSE
+
 [tool:pytest]
 minversion = 2.2.0
 pep8ignore = 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/six-1.11.0/setup.py new/six-1.12.0/setup.py
--- old/six-1.11.0/setup.py     2017-09-17 20:46:32.000000000 +0200
+++ new/six-1.12.0/setup.py     2018-12-10 01:59:34.000000000 +0100
@@ -1,4 +1,4 @@
-# Copyright (c) 2010-2017 Benjamin Peterson
+# Copyright (c) 2010-2018 Benjamin Peterson
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -31,6 +31,7 @@
 import six
 
 six_classifiers = [
+    "Development Status :: 5 - Production/Stable",
     "Programming Language :: Python :: 2",
     "Programming Language :: Python :: 3",
     "Intended Audience :: Developers",
@@ -46,11 +47,12 @@
       version=six.__version__,
       author="Benjamin Peterson",
       author_email="benja...@python.org",
-      url="http://pypi.python.org/pypi/six/";,
+      url="https://github.com/benjaminp/six";,
       tests_require=["pytest"],
       py_modules=["six"],
       description="Python 2 and 3 compatibility utilities",
       long_description=six_long_description,
       license="MIT",
-      classifiers=six_classifiers
+      classifiers=six_classifiers,
+      python_requires=">=2.6, !=3.0.*, !=3.1.*",
       )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/six-1.11.0/six.egg-info/PKG-INFO 
new/six-1.12.0/six.egg-info/PKG-INFO
--- old/six-1.11.0/six.egg-info/PKG-INFO        2017-09-17 20:46:53.000000000 
+0200
+++ new/six-1.12.0/six.egg-info/PKG-INFO        2018-12-10 01:59:56.000000000 
+0100
@@ -1,19 +1,26 @@
-Metadata-Version: 1.1
+Metadata-Version: 1.2
 Name: six
-Version: 1.11.0
+Version: 1.12.0
 Summary: Python 2 and 3 compatibility utilities
-Home-page: http://pypi.python.org/pypi/six/
+Home-page: https://github.com/benjaminp/six
 Author: Benjamin Peterson
 Author-email: benja...@python.org
 License: MIT
-Description: .. image:: http://img.shields.io/pypi/v/six.svg
-           :target: https://pypi.python.org/pypi/six
+Description: .. image:: https://img.shields.io/pypi/v/six.svg
+           :target: https://pypi.org/project/six/
+           :alt: six on PyPI
         
         .. image:: https://travis-ci.org/benjaminp/six.svg?branch=master
-            :target: https://travis-ci.org/benjaminp/six
+           :target: https://travis-ci.org/benjaminp/six
+           :alt: six on TravisCI
         
-        .. image:: http://img.shields.io/badge/license-MIT-green.svg
+        .. image:: https://readthedocs.org/projects/six/badge/?version=latest
+           :target: https://six.readthedocs.io/
+           :alt: six's documentation on Read the Docs
+        
+        .. image:: https://img.shields.io/badge/license-MIT-green.svg
            :target: https://github.com/benjaminp/six/blob/master/LICENSE
+           :alt: MIT License badge
         
         Six is a Python 2 and 3 compatibility library.  It provides utility 
functions
         for smoothing over the differences between the Python versions with 
the goal of
@@ -24,7 +31,7 @@
         file, so it can be easily copied into your project. (The copyright and 
license
         notice must be retained.)
         
-        Online documentation is at http://six.rtfd.org.
+        Online documentation is at https://six.readthedocs.io/.
         
         Bugs can be reported to https://github.com/benjaminp/six.  The code 
can also
         be found there.
@@ -33,9 +40,11 @@
         list: https://mail.python.org/mailman/listinfo/python-porting
         
 Platform: UNKNOWN
+Classifier: Development Status :: 5 - Production/Stable
 Classifier: Programming Language :: Python :: 2
 Classifier: Programming Language :: Python :: 3
 Classifier: Intended Audience :: Developers
 Classifier: License :: OSI Approved :: MIT License
 Classifier: Topic :: Software Development :: Libraries
 Classifier: Topic :: Utilities
+Requires-Python: >=2.6, !=3.0.*, !=3.1.*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/six-1.11.0/six.py new/six-1.12.0/six.py
--- old/six-1.11.0/six.py       2017-09-17 20:46:32.000000000 +0200
+++ new/six-1.12.0/six.py       2018-12-10 01:59:34.000000000 +0100
@@ -1,4 +1,4 @@
-# Copyright (c) 2010-2017 Benjamin Peterson
+# Copyright (c) 2010-2018 Benjamin Peterson
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -29,7 +29,7 @@
 import types
 
 __author__ = "Benjamin Peterson <benja...@python.org>"
-__version__ = "1.11.0"
+__version__ = "1.12.0"
 
 
 # Useful for very coarse version differentiation.
@@ -844,10 +844,71 @@
                 orig_vars.pop(slots_var)
         orig_vars.pop('__dict__', None)
         orig_vars.pop('__weakref__', None)
+        if hasattr(cls, '__qualname__'):
+            orig_vars['__qualname__'] = cls.__qualname__
         return metaclass(cls.__name__, cls.__bases__, orig_vars)
     return wrapper
 
 
+def ensure_binary(s, encoding='utf-8', errors='strict'):
+    """Coerce **s** to six.binary_type.
+
+    For Python 2:
+      - `unicode` -> encoded to `str`
+      - `str` -> `str`
+
+    For Python 3:
+      - `str` -> encoded to `bytes`
+      - `bytes` -> `bytes`
+    """
+    if isinstance(s, text_type):
+        return s.encode(encoding, errors)
+    elif isinstance(s, binary_type):
+        return s
+    else:
+        raise TypeError("not expecting type '%s'" % type(s))
+
+
+def ensure_str(s, encoding='utf-8', errors='strict'):
+    """Coerce *s* to `str`.
+
+    For Python 2:
+      - `unicode` -> encoded to `str`
+      - `str` -> `str`
+
+    For Python 3:
+      - `str` -> `str`
+      - `bytes` -> decoded to `str`
+    """
+    if not isinstance(s, (text_type, binary_type)):
+        raise TypeError("not expecting type '%s'" % type(s))
+    if PY2 and isinstance(s, text_type):
+        s = s.encode(encoding, errors)
+    elif PY3 and isinstance(s, binary_type):
+        s = s.decode(encoding, errors)
+    return s
+
+
+def ensure_text(s, encoding='utf-8', errors='strict'):
+    """Coerce *s* to six.text_type.
+
+    For Python 2:
+      - `unicode` -> `unicode`
+      - `str` -> `unicode`
+
+    For Python 3:
+      - `str` -> `str`
+      - `bytes` -> decoded to `str`
+    """
+    if isinstance(s, binary_type):
+        return s.decode(encoding, errors)
+    elif isinstance(s, text_type):
+        return s
+    else:
+        raise TypeError("not expecting type '%s'" % type(s))
+
+
+
 def python_2_unicode_compatible(klass):
     """
     A decorator that defines __unicode__ and __str__ methods under Python 2.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/six-1.11.0/test_six.py new/six-1.12.0/test_six.py
--- old/six-1.11.0/test_six.py  2017-09-17 20:46:32.000000000 +0200
+++ new/six-1.12.0/test_six.py  2018-12-10 01:59:34.000000000 +0100
@@ -1,4 +1,4 @@
-# Copyright (c) 2010-2017 Benjamin Peterson
+# Copyright (c) 2010-2018 Benjamin Peterson
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -875,6 +875,26 @@
     assert type(MySlotsWeakref) is Meta
 
 
+@py.test.mark.skipif("sys.version_info[:2] < (3, 3)")
+def test_add_metaclass_nested():
+    # Regression test for https://github.com/benjaminp/six/issues/259
+    class Meta(type):
+        pass
+
+    class A:
+        class B: pass
+
+    expected = 'test_add_metaclass_nested.<locals>.A.B'
+
+    assert A.B.__qualname__ == expected
+
+    class A:
+        @six.add_metaclass(Meta)
+        class B: pass
+
+    assert A.B.__qualname__ == expected
+
+
 @py.test.mark.skipif("sys.version_info[:2] < (2, 7) or sys.version_info[:2] in 
((3, 0), (3, 1))")
 def test_assertCountEqual():
     class TestAssertCountEqual(unittest.TestCase):
@@ -932,3 +952,61 @@
         assert str(my_test) == six.u("hello")
 
     assert getattr(six.moves.builtins, 'bytes', str)(my_test) == six.b("hello")
+
+
+class EnsureTests:
+
+    # grinning face emoji
+    UNICODE_EMOJI = six.u("\U0001F600")
+    BINARY_EMOJI = b"\xf0\x9f\x98\x80"
+
+    def test_ensure_binary_raise_type_error(self):
+        with py.test.raises(TypeError):
+            six.ensure_str(8)
+
+    def test_errors_and_encoding(self):
+        six.ensure_binary(self.UNICODE_EMOJI, encoding='latin-1', 
errors='ignore')
+        with py.test.raises(UnicodeEncodeError):
+            six.ensure_binary(self.UNICODE_EMOJI, encoding='latin-1', 
errors='strict')
+
+    def test_ensure_binary_raise(self):
+        converted_unicode = six.ensure_binary(self.UNICODE_EMOJI, 
encoding='utf-8', errors='strict')
+        converted_binary = six.ensure_binary(self.BINARY_EMOJI, 
encoding="utf-8", errors='strict')
+        if six.PY2:
+            # PY2: unicode -> str
+            assert converted_unicode == self.BINARY_EMOJI and 
isinstance(converted_unicode, str)
+            # PY2: str -> str
+            assert converted_binary == self.BINARY_EMOJI and 
isinstance(converted_binary, str)
+        else:
+            # PY3: str -> bytes
+            assert converted_unicode == self.BINARY_EMOJI and 
isinstance(converted_unicode, bytes)
+            # PY3: bytes -> bytes
+            assert converted_binary == self.BINARY_EMOJI and 
isinstance(converted_binary, bytes)
+
+    def test_ensure_str(self):
+        converted_unicode = six.ensure_str(self.UNICODE_EMOJI, 
encoding='utf-8', errors='strict')
+        converted_binary = six.ensure_str(self.BINARY_EMOJI, encoding="utf-8", 
errors='strict')
+        if six.PY2:
+            # PY2: unicode -> str
+            assert converted_unicode == self.BINARY_EMOJI and 
isinstance(converted_unicode, str)
+            # PY2: str -> str
+            assert converted_binary == self.BINARY_EMOJI and 
isinstance(converted_binary, str)
+        else:
+            # PY3: str -> str
+            assert converted_unicode == self.UNICODE_EMOJI and 
isinstance(converted_unicode, str)
+            # PY3: bytes -> str
+            assert converted_binary == self.UNICODE_EMOJI and 
isinstance(converted_unicode, str)
+
+    def test_ensure_text(self):
+        converted_unicode = six.ensure_text(self.UNICODE_EMOJI, 
encoding='utf-8', errors='strict')
+        converted_binary = six.ensure_text(self.BINARY_EMOJI, 
encoding="utf-8", errors='strict')
+        if six.PY2:
+            # PY2: unicode -> unicode
+            assert converted_unicode == self.UNICODE_EMOJI and 
isinstance(converted_unicode, unicode)
+            # PY2: str -> unicode
+            assert converted_binary == self.UNICODE_EMOJI and 
isinstance(converted_unicode, unicode)
+        else:
+            # PY3: str -> str
+            assert converted_unicode == self.UNICODE_EMOJI and 
isinstance(converted_unicode, str)
+            # PY3: bytes -> str
+            assert converted_binary == self.UNICODE_EMOJI and 
isinstance(converted_unicode, str)


Reply via email to