aboutsummaryrefslogtreecommitdiffstats
path: root/examples/test_library.py
diff options
context:
space:
mode:
authorLouis Burda <dev@sinitax.com>2026-02-28 18:54:19 +0100
committerLouis Burda <dev@sinitax.com>2026-02-28 18:54:19 +0100
commitbe1dd21f8e4fbd5361531b4d8727a0d0d243e8ec (patch)
treee7b540012e0510d1304d2dac8e137545ae103f75 /examples/test_library.py
parentd70a199a72bf9a69eb4a3fcf166b0435918b2e33 (diff)
downloadselectui-main.tar.gz
selectui-main.zip
Add tests and justfileHEADmain
Diffstat (limited to 'examples/test_library.py')
-rw-r--r--examples/test_library.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/test_library.py b/examples/test_library.py
index dfcbaed..a8daffc 100644
--- a/examples/test_library.py
+++ b/examples/test_library.py
@@ -4,13 +4,14 @@ Test script to verify SelectUI works as a library.
This doesn't require user interaction - just checks that the API works.
"""
-import sys
import os
+import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'src'))
from selectui import SelectUI
+
def test_initialization():
"""Test that SelectUI can be initialized with items."""
items = [
@@ -26,7 +27,7 @@ def test_initialization():
)
assert app.items == items
- assert app.oneshot == True
+ assert app.oneshot
assert app.title_key == "title"
assert app.subtitle_key == "subtitle"
assert app.selected_item is None
@@ -73,7 +74,7 @@ def test_events_mode():
events_mode=True
)
- assert app.events_mode == True
+ assert app.events_mode
print("✓ Events mode test passed")
@@ -85,7 +86,7 @@ def test_command_template():
)
assert app.command_template == "echo {}"
- assert app.input_mode == True
+ assert app.input_mode
print("✓ Command template test passed")