예제 #1
0
class ConsoleTest(unittest.TestCase):
    def setUp(self):
        from interfaces import Console

        self.console = Console()

    def test_start(self):
        from jarvis import Jarvis

        self.console.jarvis(Jarvis())
        self.console.start()

    def test_console(self):
        self.assertTrue(hasattr(self.console,"_console"))

    def test_console_exception(self):
        from interfaces import ConsoleException
        with self.assertRaises(ConsoleException):
            self.console._console()
예제 #2
0
    def setUp(self):
        from interfaces import Console

        self.console = Console()
예제 #3
0
파일: start.py 프로젝트: 0x1001/jarvis
    from database import WordDataBaseBuilder
    from database import TrainingDataBaseBuilder
    from database import AbilitiesDataBaseBuilder
    from database import InnerVoiceDataBaseBuilder
    from interfaces import Console

    wd_builder = WordDataBaseBuilder()
    wd_builder.addTxtFile("learning_material/traning.txt")

    td_builder = TrainingDataBaseBuilder()
    td_builder.addTxtFile("learning_material/traning.txt")

    iv_builder = InnerVoiceDataBaseBuilder()
    iv_builder.addTxtFile("learning_material/inner_voices.txt")

    ab_builder = AbilitiesDataBaseBuilder()

    he = Jarvis()
    he.createWordsDataBase(wd_builder)
    he.createTrainingDataBase(td_builder)
    he.createAbilitiesDataBase(ab_builder)
    he.createInnerVoiceDatabase(iv_builder)
    he.train()

    console = Console()
    console.jarvis(he)
    console.start()

    he.start()