use unicode literals and update tests

This commit is contained in:
Stefan Kögl
2013-04-13 23:05:36 +02:00
parent dbb80f4bf9
commit 31908848f3
2 changed files with 8 additions and 4 deletions

View File

@@ -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
"""

View File

@@ -1,6 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import doctest
import unittest
import jsonpatch