Module Unittests¶
Test suite for lorem module.
- test_lorem._T¶
Type variable.
alias of TypeVar(‘_T’)
- test_lorem.islice(iterable, stop)[source]¶
Wrapper function for
itertools.islice()
.
- test_lorem.shuffle(x, random=None)[source]¶
Mock
random.shuffle()
, but actually do nothing.
- test_lorem.randint(a, b)[source]¶
Mock
random.randint()
, but return the lower boundary.
- 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(dupe=1)[source]¶
Mock
lorem._gen_pool()
, but return a minimised pool.
- class test_lorem.TestLorem(methodName='runTest')[source]¶
Bases:
TestCase
Unittest case for
lorem
module.- mock_shuffle = <unittest.mock._patch object>¶
Mock
random.shuffle()
- mock_randint = <unittest.mock._patch object>¶
Mock
random.randint()
- mock_choice_first = <unittest.mock._patch object>¶
Mock
random.choice()
by choosing the first item.
- mock_choice_last = <unittest.mock._patch object>¶
Mock
random.choice()
by choosing the last item.
- mock_text = <unittest.mock._patch object>¶
Mock
lorem._TEXT
by a minimised pool (['lorem', 'ipsum']
).
- mock_pool = <unittest.mock._patch object>¶
Mock
lorem._gen_pool()
.
- test_set_pool()[source]¶
Test
lorem.set_pool()
.
- test_gen_pool()[source]¶
Test
lorem._gen_pool()
.
- test_gen_word()[source]¶
Test
lorem._gen_word()
.
- test_gen_sentence()[source]¶
Test
lorem._gen_sentence()
.
- test_gen_paragraph()[source]¶
Test
lorem._gen_paragraph()
.
- test_word()[source]¶
Test
lorem.word()
.
- test_sentence()[source]¶
Test
lorem.sentence()
.
- test_paragraph()[source]¶
Test
lorem.paragraph()
.
- test_get_word()[source]¶
Test
lorem.get_word()
.
- test_get_sentence()[source]¶
Test
lorem.get_sentence()
.
- test_get_paragraph()[source]¶
Test
lorem.get_paragraph()
.