summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kögl <stefan@skoegl.net>2013-04-13 23:05:36 +0200
committerStefan Kögl <stefan@skoegl.net>2013-04-13 23:05:36 +0200
commit31908848f394be98f0e63d296f68107df89346bc (patch)
tree54c385f0ab826a055a2abcd0d542126e6781f892
parentdbb80f4bf9b872a552d1b5e1bf41382301f330c8 (diff)
downloadpython-json-patch-31908848f394be98f0e63d296f68107df89346bc.tar.gz
use unicode literals and update tests
-rw-r--r--jsonpatch.py10
-rwxr-xr-xtests.py2
2 files changed, 8 insertions, 4 deletions
diff --git a/jsonpatch.py b/jsonpatch.py
index ca21384..e115273 100644
--- a/jsonpatch.py
+++ b/jsonpatch.py
@@ -30,6 +30,8 @@
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
+from __future__ import unicode_literals
+
""" Apply JSON-Patches (RFC 6902) """
# Will be parsed by setup.py to determine package metadata
@@ -87,10 +89,10 @@ def apply_patch(doc, patch, in_place=False):
>>> other = apply_patch(doc, [{'op': 'add', 'path': '/baz', 'value': 'qux'}])
>>> doc is not other
True
- >>> other
- {'foo': 'bar', 'baz': 'qux'}
- >>> apply_patch(doc, [{'op': 'add', 'path': '/baz', 'value': 'qux'}], in_place=True)
- {'foo': 'bar', 'baz': 'qux'}
+ >>> other == {'foo': 'bar', 'baz': 'qux'}
+ True
+ >>> apply_patch(doc, [{'op': 'add', 'path': '/baz', 'value': 'qux'}], in_place=True) == {'foo': 'bar', 'baz': 'qux'}
+ True
>>> doc == other
True
"""
diff --git a/tests.py b/tests.py
index 8b51987..d6506e1 100755
--- a/tests.py
+++ b/tests.py
@@ -1,6 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
import doctest
import unittest
import jsonpatch