async def test__hero_nick_is_correct(data, hero_nick): dt = {"hero_nick": hero_nick} dt.update(data) train = Train(dt) train.states["user"] = USER status = await IsCorrectHeroNickSt.traveled(train) assert status == Code.IS_OK
def train(): train = Train( unique_id=UNIQUE_ID, chat_id=CHAT_ID, destination='test', storage={'FOO': 'foo'} ) return train
def test__make_train(self): train = Train( unique_id=UNIQUE_ID, chat_id=CHAT_ID, destination=DESTINATION, storage={} ) assert isinstance(train.answers, list) assert len(train.answers) == 0 assert isinstance(train.visited, list) assert len(train.visited) == 0 assert isinstance(train.has_fail, bool) assert train.has_fail is False
def _prepare_train(cls, user_info: TDict) -> TTrain: """ Создание контейнера для данных. Устанавливаем `locale` - пользователя или по умолчанию в системе. :param user_info: dict :return: app.core.train """ user_info.setdefault('locale', cls._default_locale) train = Train(unique_id=user_info['unique_id'], chat_id=user_info['chat_id'], destination=str(cls), storage={'user_info': user_info}) logger.debug(f'train: {train}') return train
def train(data): return Train(data)
def train(): train = Train(DATA) return train
def train(): return Train(unique_id='123456789-0', chat_id=123456789, destination='test', storage={'FOO': 'foo'})