summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenn Knowles <kenn.knowles@gmail.com>2013-03-26 14:11:08 -0400
committerKenn Knowles <kenn.knowles@gmail.com>2013-03-26 14:11:08 -0400
commit8317a8ad78623a00ddfb8a4290317d2ab301577a (patch)
tree601977336a07dd5bdfe12f3cbadc6009142d1b3d
parent4ae5f3f436455d0af311bef5605e2ad7bfa8011e (diff)
downloadjsonpath-rw-8317a8ad78623a00ddfb8a4290317d2ab301577a.tar.gz
Remove set literals0.8
-rw-r--r--setup.py2
-rw-r--r--tests/test_jsonpath.py14
2 files changed, 8 insertions, 8 deletions
diff --git a/setup.py b/setup.py
index 2c9e75c..4e526eb 100644
--- a/setup.py
+++ b/setup.py
@@ -13,7 +13,7 @@ readme = 'README.txt' if os.path.exists('README.txt') else 'README.md'
setuptools.setup(
name='jsonpath-rw',
- version='0.7',
+ version='0.8',
description='A robust and significantly extended implementation of JSONPath for Python, with a clear AST for metaprogramming.',
author='Kenneth Knowles',
author_email='kenn.knowles@gmail.com',
diff --git a/tests/test_jsonpath.py b/tests/test_jsonpath.py
index d097094..9f341d1 100644
--- a/tests/test_jsonpath.py
+++ b/tests/test_jsonpath.py
@@ -95,7 +95,7 @@ class TestJsonPath(unittest.TestCase):
if isinstance(target, list):
assert [r.value for r in result] == target
elif isinstance(target, set):
- assert {r.value for r in result} == target
+ assert set([r.value for r in result]) == target
else:
assert result.value == target
@@ -103,10 +103,10 @@ class TestJsonPath(unittest.TestCase):
jsonpath.auto_id_field = None
self.check_cases([ ('foo', {'foo': 'baz'}, ['baz']),
('foo,baz', {'foo': 1, 'baz': 2}, [1, 2]),
- ('*', {'foo': 1, 'baz': 2}, {1, 2}) ])
+ ('*', {'foo': 1, 'baz': 2}, set([1, 2])) ])
jsonpath.auto_id_field = 'id'
- self.check_cases([ ('*', {'foo': 1, 'baz': 2}, {1, 2, '@'}) ])
+ self.check_cases([ ('*', {'foo': 1, 'baz': 2}, set([1, 2, '@'])) ])
def test_index_value(self):
self.check_cases([
@@ -154,7 +154,7 @@ class TestJsonPath(unittest.TestCase):
if isinstance(target, list):
assert [str(r.full_path) for r in result] == target
elif isinstance(target, set):
- assert {str(r.full_path) for r in result} == target
+ assert set([str(r.full_path) for r in result]) == target
else:
assert str(result.path) == target
@@ -162,10 +162,10 @@ class TestJsonPath(unittest.TestCase):
jsonpath.auto_id_field = None
self.check_paths([ ('foo', {'foo': 'baz'}, ['foo']),
('foo,baz', {'foo': 1, 'baz': 2}, ['foo', 'baz']),
- ('*', {'foo': 1, 'baz': 2}, {'foo', 'baz'}) ])
+ ('*', {'foo': 1, 'baz': 2}, set(['foo', 'baz'])) ])
jsonpath.auto_id_field = 'id'
- self.check_paths([ ('*', {'foo': 1, 'baz': 2}, {'foo', 'baz', 'id'}) ])
+ self.check_paths([ ('*', {'foo': 1, 'baz': 2}, set(['foo', 'baz', 'id'])) ])
def test_index_paths(self):
self.check_paths([('[0]', [42], ['[0]']),
@@ -195,7 +195,7 @@ class TestJsonPath(unittest.TestCase):
('*.id',
{'foo':{'id': 1},
'baz': 2},
- {'1', 'baz'}) ])
+ set(['1', 'baz'])) ])
def test_index_auto_id(self):
jsonpath.auto_id_field = "id"