Skip to content

Commit d1cb1d1

Browse files
committed
Add an integration test for scyjava's AWT logic
1 parent 02984cd commit d1cb1d1

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

tests/it/awt.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
"""
2+
Test scyjava AWT-related functions.
3+
"""
4+
5+
import sys
6+
7+
import scyjava
8+
9+
assert not scyjava.jvm_started()
10+
scyjava.start_jvm()
11+
12+
if scyjava.is_jvm_headless():
13+
# NB: We did not configure the JVM to run in headless mode.
14+
# But it is still headless, which indicates we are running
15+
# on a headless system, such as continuous integration (CI).
16+
# In that case, we are not able to perform this test.
17+
sys.exit(0)
18+
19+
assert not scyjava.is_awt_initialized()
20+
21+
Frame = scyjava.jimport("java.awt.Frame")
22+
f = Frame()
23+
24+
assert scyjava.is_awt_initialized()

0 commit comments

Comments
 (0)