Skip to content

Commit d7653d7

Browse files
committed
Add a couple more assertions about json and hashability. Ref #97.
1 parent af6c8ef commit d7653d7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

importlib_metadata/tests/test_main.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from __future__ import unicode_literals
33

44
import re
5+
import json
56
import pickle
67
import textwrap
78
import unittest
@@ -210,3 +211,14 @@ def test_repr(self):
210211
assert 'EntryPoint' in repr(self.ep)
211212
assert 'name=' in repr(self.ep)
212213
assert "'name'" in repr(self.ep)
214+
215+
def test_hashable(self):
216+
"""EntryPoints should be hashable"""
217+
hash(self.ep)
218+
219+
def test_json_dump(self):
220+
"""
221+
json should not expect to be able to dump an EntryPoint
222+
"""
223+
with self.assertRaises(Exception):
224+
json.dumps(self.ep)

0 commit comments

Comments
 (0)