use unicode literals and update tests
This commit is contained in:
10
jsonpatch.py
10
jsonpatch.py
@@ -30,6 +30,8 @@
|
|||||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
""" Apply JSON-Patches (RFC 6902) """
|
""" Apply JSON-Patches (RFC 6902) """
|
||||||
|
|
||||||
# Will be parsed by setup.py to determine package metadata
|
# 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'}])
|
>>> other = apply_patch(doc, [{'op': 'add', 'path': '/baz', 'value': 'qux'}])
|
||||||
>>> doc is not other
|
>>> doc is not other
|
||||||
True
|
True
|
||||||
>>> other
|
>>> other == {'foo': 'bar', 'baz': 'qux'}
|
||||||
{'foo': 'bar', 'baz': 'qux'}
|
True
|
||||||
>>> apply_patch(doc, [{'op': 'add', 'path': '/baz', 'value': 'qux'}], in_place=True)
|
>>> apply_patch(doc, [{'op': 'add', 'path': '/baz', 'value': 'qux'}], in_place=True) == {'foo': 'bar', 'baz': 'qux'}
|
||||||
{'foo': 'bar', 'baz': 'qux'}
|
True
|
||||||
>>> doc == other
|
>>> doc == other
|
||||||
True
|
True
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user