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
e2a0e83c
Commit
e2a0e83c
authored
9 years ago
by
ulif
Browse files
Options
Downloads
Patches
Plain Diff
Enable delimiter option in frontend.
parent
525d8872
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
diceware/__init__.py
+2
-1
2 additions, 1 deletion
diceware/__init__.py
tests/test_diceware.py
+14
-0
14 additions, 0 deletions
tests/test_diceware.py
with
16 additions
and
1 deletion
diceware/__init__.py
+
2
−
1
View file @
e2a0e83c
...
...
@@ -188,7 +188,8 @@ def main(args=None):
print
(
get_passphrase
(
wordnum
=
options
.
num
,
specialsnum
=
options
.
specials
,
delimiter
=
options
.
delimiter
,
capitalized
=
options
.
capitalize
,
fd
=
options
.
infile
fd
=
options
.
infile
,
)
)
This diff is collapsed.
Click to expand it.
tests/test_diceware.py
+
14
−
0
View file @
e2a0e83c
...
...
@@ -145,6 +145,11 @@ class TestDicewareModule(object):
phrase
=
get_passphrase
(
capitalized
=
False
)
assert
phrase
.
lower
()
==
phrase
def
test_get_passphrase_delimiters
(
self
):
# we can set separators
phrase
=
get_passphrase
(
delimiter
=
"
"
)
assert
"
"
in
phrase
def
test_print_version
(
self
,
capsys
):
# we can print version infos
print_version
()
...
...
@@ -252,3 +257,12 @@ class TestDicewareModule(object):
main
()
out
,
err
=
capsys
.
readouterr
()
assert
out
==
'
Word1Word1
\n
'
def
test_main_delimiters
(
self
,
argv_handler
,
capsys
):
# delimiters are respected on calls to main
sys
.
stdin
=
StringIO
(
"
word1
\n
"
)
sys
.
argv
=
[
'
diceware
'
,
'
-n
'
,
'
2
'
,
'
-d
'
,
'
DELIM
'
,
'
-
'
]
main
()
out
,
err
=
capsys
.
readouterr
()
assert
out
==
'
Word1DELIMWord1
\n
'
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