Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
asn1-value-editor
Commits
6d7758bf
Commit
6d7758bf
authored
Jul 16, 2016
by
Maxime Perrotin
Browse files
Stabilize test setup
parent
4c5c2d74
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/pytest/test_standalone.py
View file @
6d7758bf
...
@@ -11,28 +11,30 @@ Use py.test-2.7 to run these tests, and make sure you have installed pytest-qt
...
@@ -11,28 +11,30 @@ Use py.test-2.7 to run these tests, and make sure you have installed pytest-qt
pip install --user pytest-qt
pip install --user pytest-qt
'''
'''
def
common
(
editor
,
typeName
,
defValue
):
TEST
=
editor
.
SingleValueEditor
(
'data/dv1.asn'
)
def
common
(
typeName
,
defValue
):
''' Set up test case: create asn1 editor and fill with default value '''
''' Set up test case: create asn1 editor and fill with default value '''
widget
=
editor
.
setupEdit
(
typeName
,
defValue
=
defValue
)[
'editor'
]
widget
=
TEST
.
setupEdit
(
typeName
,
defValue
=
defValue
)[
'editor'
]
widget
.
getVariable
(
dest
=
widget
.
asn1Instance
)
widget
.
getVariable
(
dest
=
widget
.
asn1Instance
)
return
widget
.
asn1Instance
.
GSER
()
return
widget
.
asn1Instance
.
GSER
()
def
test_manytypes
(
qtbot
):
def
test_bool
(
qtbot
):
''' Test all types defined in dv1.asn '''
''' Test boolean values '''
s
=
editor
.
SingleValueEditor
(
'data/dv1.asn'
)
typeName
=
"Type-SingleBool"
typeName
=
"Type-SingleBool"
defValue
=
'TRUE'
defValue
=
'TRUE'
result
=
common
(
s
,
typeName
,
defValue
)
result
=
common
(
typeName
,
defValue
)
assert
result
==
defValue
assert
result
==
defValue
defValue
=
'FALSE'
defValue
=
'FALSE'
result
=
common
(
s
,
typeName
,
defValue
)
result
=
common
(
typeName
,
defValue
)
assert
result
==
defValue
assert
result
==
defValue
def
test_int
(
qtbot
):
''' Test integer value '''
typeName
=
"Type-SingleInt"
typeName
=
"Type-SingleInt"
defValue
=
'42'
defValue
=
'42'
result
=
common
(
s
,
typeName
,
defValue
)
result
=
common
(
typeName
,
defValue
)
assert
result
==
defValue
assert
result
==
defValue
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment