コード例 #1
0
ファイル: consoletest.py プロジェクト: 0x1001/jarvis
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
ファイル: consoletest.py プロジェクト: 0x1001/jarvis
    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()