Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
diceware-debian
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drebs
diceware-debian
Commits
4cd82553
Commit
4cd82553
authored
8 years ago
by
ulif
Browse files
Options
Downloads
Patches
Plain Diff
Split overlong test.
parent
5196e84e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_random_sources.py
+8
-5
8 additions, 5 deletions
tests/test_random_sources.py
with
8 additions
and
5 deletions
tests/test_random_sources.py
+
8
−
5
View file @
4cd82553
...
...
@@ -229,17 +229,20 @@ class TestRealDiceRandomSource(object):
out
,
err
=
capsys
.
readouterr
()
assert
"
Please roll 5 dice (or a single dice 5 times).
"
in
out
def
test_choice_copes_with_small_sequences
(
self
,
capsys
,
fake_input
):
# We handle sequences correctly, that have less elements than the used
# dice sides.
def
test_choice_copes_with_sequence_len_1
(
self
,
capsys
,
fake_input
):
# choice copes with sequences of len 1
src
=
RealDiceRandomSource
(
None
)
src
.
dice_sides
=
6
# A length of 1 requires no rolls
fake_input
([
"
1
"
])
picked
=
src
.
choice
([
1
])
out
,
err
=
capsys
.
readouterr
()
assert
"
roll
"
not
in
out
assert
picked
==
1
def
test_choice_copes_with_small_sequences
(
self
,
capsys
,
fake_input
):
# We handle sequences correctly, that have less elements than the used
# dice sides.
src
=
RealDiceRandomSource
(
None
)
src
.
dice_sides
=
6
# A length of 2,3 only requires 1 roll
for
choice_length
in
(
2
,
3
):
fake_input
([
"
1
"
])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment