test_standalone.py 915 Bytes
Newer Older
Maxime Perrotin's avatar
Maxime Perrotin committed
1
2
3
4
5
6
7
8
#!/usr/bin/env python

import sys

sys.path.insert(0, '../..')
from asn1_value_editor import standalone_editor as editor
editor.logger.setLevel(editor.logging.DEBUG)

9
'''
Maxime Perrotin's avatar
Maxime Perrotin committed
10
Use py.test-2.7 to run these tests, and make sure you have installed pytest-qt
11
12
13
14
pip install --user pytest-qt
'''

def test_1(qtbot):
Maxime Perrotin's avatar
Maxime Perrotin committed
15
    ''' Test with a single boolean type '''
Maxime Perrotin's avatar
Maxime Perrotin committed
16
    expected = 'TRUE'
Maxime Perrotin's avatar
Maxime Perrotin committed
17
18
    s = editor.SingleValueEditor('data/dv2.asn',
                                 paramsAndTypes={'param': 'Ahah'})
Maxime Perrotin's avatar
Maxime Perrotin committed
19
20
21
22
23
    widget = s.setupEdit('Ahah', defValue=expected)['editor']
    widget.getVariable(dest=widget.asn1Instance)
    result = widget.asn1Instance.GSER()
    print result
    assert result == expected
Maxime Perrotin's avatar
Maxime Perrotin committed
24
25
26
27
28
29
30


def test_2():
    ''' Test '''
    assert True

if __name__ == '__main__':
Maxime Perrotin's avatar
Maxime Perrotin committed
31
32
33
    print('You must run py.test-2.7 to execute this test script')
    print('Make sure you have pytest-qt (pip install --user pytest-qt)')
    sys.exit(1)