Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ VoterInfo.json
myinfo\.csv
.vscode
agenda.csv
.venv/
7 changes: 2 additions & 5 deletions jarviscli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,5 @@ def main():
jarvis.executor(command)


if __name__ == '__main__':
if check_python_version():
main()
else:
print("Sorry! Only Python 3 supported.")
if __name__ == "__main__":
main()
23 changes: 23 additions & 0 deletions jarviscli/tests/test_bootstrap_entrypoint.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# jarviscli/tests/test_bootstrap_entrypoint.py

import unittest
from unittest import mock
import importlib

class TestBootstrapEntrypoint(unittest.TestCase):
def test_module_runs_cmdloop_via_start(self):
# Import the entry module once so we can patch the Jarvis symbol it bound
import jarviscli.__main__ as entry

# Patch the Jarvis name inside the entry module to avoid heavy init/plugin loading
with mock.patch("jarviscli.__main__.Jarvis") as MockJarvis:
inst = MockJarvis.return_value
# Call the CLI entrypoint
entry.main()
# Ensure the entrypoint delegates to Jarvis.start()
inst.start.assert_called_once()

def test_entry_exposes_main_callable(self):
# Sanity: re-import to ensure module loads and exposes main()
entry = importlib.import_module("jarviscli.__main__")
self.assertTrue(callable(getattr(entry, "main", None)))