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
94a6b407
Commit
94a6b407
authored
9 years ago
by
ulif
Browse files
Options
Downloads
Patches
Plain Diff
Add more get_wordlist_names tests.
and bring coverage back to 100%.
parent
b7412123
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_diceware.py
+16
-0
16 additions, 0 deletions
tests/test_diceware.py
with
16 additions
and
0 deletions
tests/test_diceware.py
+
16
−
0
View file @
94a6b407
...
...
@@ -126,6 +126,22 @@ class TestDicewareModule(object):
wlist_path
.
write
(
"
some
\n
irrelevant
\n
words
"
)
assert
get_wordlist_names
()
==
[
'
en_8k
'
]
def
test_get_wordlist_names_files_only
(
self
,
wordlists_dir
):
# non-files are ignored when looking for wordlist names
sub_dir
=
wordlists_dir
.
mkdir
(
'
subdir
'
)
# a subdir
sub_dir
.
join
(
"
somfile_name.txt
"
).
write
(
"
Some
\n
text
"
)
# and a file in
assert
get_wordlist_names
()
==
[]
def
test_get_wordlist_names_requires_underscore
(
self
,
wordlists_dir
):
# we only recognize wordlist files with underscore in name
wordlists_dir
.
join
(
"
file-without-underscore.txt
"
).
write
(
"
a
\n
b
\n
"
)
assert
get_wordlist_names
()
==
[]
def
test_get_wordlist_names_requires_dot
(
self
,
wordlists_dir
):
# we only recognize wordlist files with dot in name
wordlists_dir
.
join
(
"
file_without_dot-in-name
"
).
write
(
"
a
\n
b
\n
"
)
assert
get_wordlist_names
()
==
[]
def
test_insert_special_char
(
self
):
# we can insert special chars in words.
fake_rnd
=
FakeRandom
()
...
...
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