test_standalone.py 894 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
10
11
12
13
14
'''
Use py.test2.7 to run these tests, and make sure you have installed pytest-qt
pip install --user pytest-qt
'''

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


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

if __name__ == '__main__':
    for name, value in dict(globals()).viewitems():
        if name.startswith('test_'):
            print('---- Executing {} ----'.format(name))
            value()
            print('---- Done - {} ----\n'.format(name))