jsonpointer 3.10__tar.gz → 3.11__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jsonpointer
3
- Version: 3.10
3
+ Version: 3.11
4
4
  Summary: Identify specific nodes in a JSON document (RFC 6901)
5
5
  Home-page: https://github.com/stefankoegl/python-json-pointer
6
6
  Author: Stefan Kögl
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jsonpointer
3
- Version: 3.10
3
+ Version: 3.11
4
4
  Summary: Identify specific nodes in a JSON document (RFC 6901)
5
5
  Home-page: https://github.com/stefankoegl/python-json-pointer
6
6
  Author: Stefan Kögl
@@ -32,7 +32,7 @@
32
32
 
33
33
  # Will be parsed by setup.py to determine package metadata
34
34
  __author__ = 'Stefan Kögl <stefan@skoegl.net>'
35
- __version__ = '3.10'
35
+ __version__ = '3.11'
36
36
  __website__ = 'https://github.com/stefankoegl/python-json-pointer'
37
37
  __license__ = 'Modified BSD License'
38
38
 
@@ -420,7 +420,7 @@ class JsonPointer:
420
420
  """
421
421
 
422
422
  if not isinstance(other, JsonPointer):
423
- return False
423
+ return NotImplemented
424
424
 
425
425
  return self.parts == other.parts
426
426
 
@@ -171,6 +171,23 @@ class ComparisonTests(unittest.TestCase):
171
171
  # a pointer compares not-equal to objects of other types
172
172
  self.assertFalse(p1 == "/something/1/b")
173
173
 
174
+ def test_other_types_remain_unequal(self):
175
+ for other in ["/a/b/c", None, 1, object()]:
176
+ for left, right in [(self.ptr1, other), (other, self.ptr1)]:
177
+ with self.subTest(left=left, right=right):
178
+ self.assertFalse(left == right)
179
+ self.assertTrue(left != right)
180
+
181
+ def test_reflected_equality(self):
182
+ for left, right in [(self.ptr1, mock.ANY), (mock.ANY, self.ptr1)]:
183
+ with self.subTest(left=left, right=right):
184
+ self.assertTrue(left == right)
185
+
186
+ def test_reflected_inequality(self):
187
+ for left, right in [(self.ptr1, mock.ANY), (mock.ANY, self.ptr1)]:
188
+ with self.subTest(left=left, right=right):
189
+ self.assertFalse(left != right)
190
+
174
191
  def test_contains(self):
175
192
  self.assertTrue(self.ptr1.contains(self.ptr2))
176
193
  self.assertTrue(self.ptr1.contains(self.ptr1))
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes