import unittest

from elironwars.console import ConsoleUi
from elironwars.entrypoints import Entrypoints


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()
