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
196f3282
Commit
196f3282
authored
9 years ago
by
ulif
Browse files
Options
Downloads
Patches
Plain Diff
Add --version option in option handler.
parent
b967e100
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.py
+4
-0
4 additions, 0 deletions
diceware.py
tests/test_diceware.py
+6
-0
6 additions, 0 deletions
tests/test_diceware.py
with
10 additions
and
0 deletions
diceware.py
+
4
−
0
View file @
196f3282
...
...
@@ -40,6 +40,10 @@ def handle_options(args):
type
=
argparse
.
FileType
(
'
r
'
),
help
=
"
Input wordlist. `-
'
will read from stdin.
"
,
)
parser
.
add_argument
(
'
--version
'
,
action
=
'
store_true
'
,
help
=
'
output version information and exit.
'
,
)
parser
.
set_defaults
(
capitalize
=
True
)
args
=
parser
.
parse_args
(
args
)
return
args
...
...
This diff is collapsed.
Click to expand it.
tests/test_diceware.py
+
6
−
0
View file @
196f3282
...
...
@@ -157,6 +157,7 @@ class TestDicewareModule(object):
assert
options
.
capitalize
is
True
assert
options
.
specials
==
0
assert
options
.
infile
is
None
assert
options
.
version
is
False
def
test_handle_options_infile
(
self
,
tmpdir
):
# we can give an infile
...
...
@@ -167,6 +168,11 @@ class TestDicewareModule(object):
assert
options
.
infile
is
not
None
assert
options
.
infile
.
read
()
==
'
one
\n
two
\n
'
def
test_handle_options_version
(
self
):
# we can ask for version infos
options
=
handle_options
([
'
--version
'
,
])
assert
options
.
version
is
True
def
test_main
(
self
,
capsys
):
# we can get a passphrase
main
([])
# call with default options in place
...
...
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