Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimizations from #16 reverted #21

Open
stefankoegl opened this issue Sep 10, 2017 · 0 comments
Open

Optimizations from #16 reverted #21

stefankoegl opened this issue Sep 10, 2017 · 0 comments

Comments

@stefankoegl
Copy link
Owner

I had to revert the optimizations from #16, because the tests of jsonpatch failed with

$ ./tests.py 
........E.......E...................................................................
======================================================================
ERROR: test_append (__main__.ApplyPatchTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./tests.py", line 218, in test_append
    {'op': 'add', 'path': '/foo/-', 'value': 4},
  File "/home/stefan/python-json-patch/jsonpatch.py", line 154, in apply_patch
    return patch.apply(doc, in_place)
  File "/home/stefan/python-json-patch/jsonpatch.py", line 364, in apply
    obj = operation.apply(obj)
  File "/home/stefan/python-json-patch/jsonpatch.py", line 438, in apply
    elif part > len(subobj) or part < 0:
TypeError: unorderable types: EndOfList() > int()

======================================================================
ERROR: test_js_file (__main__.ApplyPatchTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./tests.py", line 23, in test_js_file
    result = jsonpatch.apply_patch(test['doc'], test['patch'])
  File "/home/stefan/python-json-patch/jsonpatch.py", line 154, in apply_patch
    return patch.apply(doc, in_place)
  File "/home/stefan/python-json-patch/jsonpatch.py", line 364, in apply
    obj = operation.apply(obj)
  File "/home/stefan/python-json-patch/jsonpatch.py", line 438, in apply
    elif part > len(subobj) or part < 0:
TypeError: unorderable types: EndOfList() > int()

----------------------------------------------------------------------
Ran 84 tests in 0.019s

FAILED (errors=2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant