Skip to content

Commit 2f11f0d

Browse files
committed
Add unit test for inspect.members function
1 parent 5fe1461 commit 2f11f0d

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

tests/test_inspect.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
"""
2+
Tests for functions in inspect submodule.
3+
"""
4+
5+
from scyjava import inspect
6+
from scyjava.config import mode, Mode
7+
8+
9+
class TestInspect(object):
10+
"""
11+
Test scyjava.inspect convenience functions.
12+
"""
13+
14+
def test_inspect_members(self):
15+
if mode == Mode.JEP:
16+
# JEP does not support the jclass function.
17+
return
18+
members = []
19+
inspect.members("java.lang.Iterable", writer=members.append)
20+
expected = [
21+
"Source code URL: java.lang.NullPointerException",
22+
" * indicates static modifier",
23+
"java.util.Iterator = iterator()",
24+
"java.util.Spliterator = spliterator()",
25+
"void = forEach(java.util.function.Consumer)",
26+
"",
27+
"",
28+
]
29+
assert expected == "".join(members).split("\n")

0 commit comments

Comments
 (0)