Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
ProMod3
Manage
Activity
Members
Plan
Jira
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
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
schwede
ProMod3
Commits
bd7accf6
Commit
bd7accf6
authored
9 years ago
by
Bienchen
Browse files
Options
Downloads
Patches
Plain Diff
Testing missing arguments
parent
c49c60a9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/tests/test_pm3argparse.py
+26
-0
26 additions, 0 deletions
core/tests/test_pm3argparse.py
with
26 additions
and
0 deletions
core/tests/test_pm3argparse.py
+
26
−
0
View file @
bd7accf6
...
@@ -77,6 +77,32 @@ class PM3ArgParseTests(unittest.TestCase):
...
@@ -77,6 +77,32 @@ class PM3ArgParseTests(unittest.TestCase):
'
test.
\n\n
optional arguments:
\n
-h, --help show
'
+
'
test.
\n\n
optional arguments:
\n
-h, --help show
'
+
'
this help message and exit
'
])
'
this help message and exit
'
])
def
testAddAlignmentNoTrgArg
(
self
):
# check failure on missing trg: argument
parser
=
pm3argparse
.
PM3ArgumentParser
(
__doc__
,
action
=
False
)
parser
.
AddAlignment
()
parser
.
AssembleParser
()
with
self
.
assertRaises
(
SystemExit
)
as
ecd
:
parser
.
Parse
([
'
--fasta
'
,
'
data/fasta/alignment.fas
'
])
self
.
assertEqual
(
ecd
.
exception
.
code
,
2
)
self
.
assertEqual
(
self
.
log
.
messages
[
'
ERROR
'
],
[
'
usage: test_pm3argparse.py [-h] [-f trg:<NAME>
'
+
'
<FILE>]
'
,
'
test_pm3argparse.py: error: argument
'
+
'
-f/--fasta: expected 2 argument(s)
'
])
def
testAddAlignmentNoFileArg
(
self
):
# check failure on missing file argument
parser
=
pm3argparse
.
PM3ArgumentParser
(
__doc__
,
action
=
False
)
parser
.
AddAlignment
()
parser
.
AssembleParser
()
with
self
.
assertRaises
(
SystemExit
)
as
ecd
:
parser
.
Parse
([
'
--fasta
'
,
'
trg:target
'
])
self
.
assertEqual
(
ecd
.
exception
.
code
,
2
)
self
.
assertEqual
(
self
.
log
.
messages
[
'
ERROR
'
],
[
'
usage: test_pm3argparse.py [-h] [-f trg:<NAME>
'
+
'
<FILE>]
'
,
'
test_pm3argparse.py: error: argument
'
+
'
-f/--fasta: expected 2 argument(s)
'
])
def
testAddAlignemntNoTrgPfx
(
self
):
def
testAddAlignemntNoTrgPfx
(
self
):
# checking that we fail on missing 'trg:' prefix for arguments of
# checking that we fail on missing 'trg:' prefix for arguments of
# --fasta
# --fasta
...
...
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