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
73489e3b
Commit
73489e3b
authored
10 years ago
by
ulif
Browse files
Options
Downloads
Patches
Plain Diff
Make sure we get version infos from main.
parent
bee5764f
No related branches found
Branches containing commit
Tags
v0.2
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
+10
-1
10 additions, 1 deletion
tests/test_diceware.py
with
10 additions
and
1 deletion
tests/test_diceware.py
+
10
−
1
View file @
73489e3b
...
@@ -6,7 +6,7 @@ from io import StringIO
...
@@ -6,7 +6,7 @@ from io import StringIO
from
diceware
import
(
from
diceware
import
(
SRC_DIR
,
RE_LANG_CODE
,
SPECIAL_CHARS
,
get_wordlist
,
SRC_DIR
,
RE_LANG_CODE
,
SPECIAL_CHARS
,
get_wordlist
,
get_wordlist_path
,
insert_special_char
,
get_passphrase
,
get_wordlist_path
,
insert_special_char
,
get_passphrase
,
handle_options
,
main
,
handle_options
,
main
,
__version__
,
)
)
...
@@ -195,6 +195,15 @@ class TestDicewareModule(object):
...
@@ -195,6 +195,15 @@ class TestDicewareModule(object):
expected_output
=
fd
.
read
()
expected_output
=
fd
.
read
()
assert
out
==
expected_output
assert
out
==
expected_output
def
test_main_version
(
self
,
argv_handler
,
capsys
):
# we can get version infos.
sys
.
argv
=
[
'
diceware
'
,
'
--version
'
]
with
pytest
.
raises
(
SystemExit
)
as
exc_info
:
main
()
assert
exc_info
.
value
.
code
==
0
out
,
err
=
capsys
.
readouterr
()
assert
__version__
in
out
def
test_main_argv
(
self
,
argv_handler
):
def
test_main_argv
(
self
,
argv_handler
):
# main() handles sys.argv if nothing is provided
# main() handles sys.argv if nothing is provided
sys
.
argv
=
[
'
diceware
'
,
'
--help
'
]
sys
.
argv
=
[
'
diceware
'
,
'
--help
'
]
...
...
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