Module Unittests

Test suite for lorem module.

test_lorem.islice(iterable, stop)[source]

Wrapper function for itertools.islice().

Parameters:
  • iterable (Iterator[_T])

  • stop (int)

Return type:

list[_T]

test_lorem.shuffle(x, random=None)[source]

Mock random.shuffle(), but actually do nothing.

Parameters:
  • x (list[Any])

  • random (Optional[Callable[[], float]])

Return type:

None

test_lorem.randint(a, b)[source]

Mock random.randint(), but return the lower boundary.

Parameters:
Return type:

int

test_lorem.choice_first(seq)[source]

Mock random.choice(), but return the first element.

Parameters:

seq (Sequence[_T])

Return type:

_T

test_lorem.choice_last(seq)[source]

Mock random.choice(), but return the last element.

Parameters:

seq (Sequence[_T])

Return type:

_T

test_lorem.pool(self, dupe=1)[source]

Mock lorem.LoremGenerator._gen_pool(), but return a minimised pool.

Parameters:
Return type:

Iterator[str]

class test_lorem.TestLorem(methodName='runTest')[source]

Bases: TestCase

Unittest case for lorem module.

test_lorem_init()[source]

Test lorem.__init__().

Return type:

None

test_gen_word()[source]

Test lorem.LoremGenerator.gen_word().

Return type:

None

test_gen_sentence()[source]

Test lorem.LoremGenerator.gen_sentence().

Return type:

None

test_gen_paragraph()[source]

Test lorem.LoremGenerator.gen_paragraph().

Return type:

None

test_word()[source]

Test lorem.word().

Return type:

None

test_sentence()[source]

Test lorem.sentence().

Return type:

None

test_paragraph()[source]

Test lorem.paragraph().

Return type:

None

test_get_word()[source]

Test lorem.get_word().

Return type:

None

test_get_sentence()[source]

Test lorem.get_sentence().

Return type:

None

test_get_paragraph()[source]

Test lorem.get_paragraph().

Return type:

None