Пример #1
0
def generate_card_info(n=2):
    res = []

    en_text = Text('en')
    en_person = Person('en')
    en_business = Business('en')

    color_choice = Choice()

    for i in range(n):
        card = {
            'title': en_text.title(),
            'author': en_person.full_name(),
            'expansion': en_text.word(),
            'type': en_text.word(),

            'colors': color_choice(items=['white', 'black', 'red', 'green', 'blue'], unique=True, length=2),

            'lore_message': en_text.quote(),
            'lore_author': en_person.full_name()


        }
        res.append(card)

    return res
Пример #2
0
    def __init__(self, *args, **kwargs) -> None:
        """Initialize attributes lazily.

        :param args: Arguments.
        :param kwargs: Keyword arguments.
        """
        super().__init__(*args, **kwargs)
        self.choice = Choice(seed=self.seed)
Пример #3
0
def choice():
    return Choice()
Пример #4
0
def test_choice_seed(n):
    choice = Choice(seed=0xF1)
    items = ['a', 'b', 'c', 'd', 'e', 'f', 'g']

    result = choice(items=items)
    assert result == 'f'
Пример #5
0
def test_choice_seed(n):
    choice = Choice(seed=0xF1)
    items = ["a", "b", "c", "d", "e", "f", "g"]

    result = choice(items=items)
    assert result == "f"