<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import unittest
import gc
import logging
from multiprocessing import Process, Queue
import os
import sys

from shellbot import Context, Engine, ShellBot, SpaceFactory
from examples.todos import TodoFactory, Done, Drop, History, Next, Todo, Todos


my_settings = {

    'todos.items': [
        'write down the driving question',
        'gather facts and related information',
        'identify information gaps and document assumptions',
        'formulate scenarios',
        'select the most appropriate scenario',
    ],

}


class TodosTests(unittest.TestCase):

    def setUp(self):
        self.context = Context(settings=my_settings)
        self.engine = Engine(context=self.context, mouth=Queue())
        self.engine.factory = TodoFactory(self.engine.get('todos.items', []))
        self.bot = self.engine.get_bot()<commit_msg>adapt tests of examples/todos to pub-sub mechanisms<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import unittest
import gc
import logging
from multiprocessing import Process, Queue
import os
import sys

from shellbot import Context, Engine, ShellBot, SpaceFactory, Bus
from examples.todos import TodoFactory, Done, Drop, History, Next, Todo, Todos


my_settings = {

    'todos.items': [
        'write down the driving question',
        'gather facts and related information',
        'identify information gaps and document assumptions',
        'formulate scenarios',
        'select the most appropriate scenario',
    ],

}


class TodosTests(unittest.TestCase):

    def setUp(self):
        self.context = Context(settings=my_settings)
        self.engine = Engine(context=self.context, mouth=Queue())
        self.engine.factory = TodoFactory(self.engine.get('todos.items', []))
        self.engine.bus = Bus(self.context)
        self.engine.bus.check()
        self.engine.publisher = self.engine.bus.publish()
        self.bot = self.engine.get_bot()
{'fraction_non_alphanumeric': 0.10824481537683359, 'fraction_numerical': 0.0010116337885685382, 'mean_word_length': 3.356828193832599, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6060635', 'n_tokens_mistral': 577, 'n_tokens_neox': 563, 'n_words': 159}