✅ test entrypoint class
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import unittest
|
||||
|
||||
from elironwars.entrypoints import Entrypoints
|
||||
from elironwars.console import ConsoleUi
|
||||
|
||||
|
||||
class TestEntrypoints(unittest.TestCase):
|
||||
|
||||
def test_load_console_ui(self):
|
||||
console_ep = 'console'
|
||||
|
||||
ep = Entrypoints()
|
||||
self.assertIn(console_ep, ep.ui.names)
|
||||
self.assertIsInstance(ep.load_ui(console_ep), ConsoleUi)
|
||||
|
||||
def test_load_unknown_ui(self):
|
||||
unknown_ep = 'unknown'
|
||||
|
||||
ep = Entrypoints()
|
||||
self.assertNotIn(unknown_ep, ep.ui.names)
|
||||
self.assertIsNone(ep.load_ui(unknown_ep), ConsoleUi)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user