Beispiel #1
0
def main(logger, resultsDict):
    '''main program
    
    This is the place where the entire program is going
    to be generated.
    '''

    # First import all the modules, and run
    # them
    # ------------------------------------
    importModules(resultsDict)

    # Lets just create a simple testing
    # for other functions to follow
    # -----------------------------------

    sampleValues = [(1, 2), (1.2, 5), (3, 'a'), ('First', 'Second'), (55, )]

    for s in sampleValues:
        try:
            sL.simpleTestFunction(*s)
        except Exception as e:
            logger.error(
                'Unable to perform addition with values [{}]\n:{}'.format(
                    s, str(e)))

    return
def test_simpleTest():
    logging.getLogger(config['logging']['logBase'])
    assert sL.simpleTestFunction(1, 2) == 3
    assert sL.simpleTestFunction('1', '2') == '12'
    return
def test_simpleTest_fail1():
    logging.getLogger(config['logging']['logBase'])
    with pytest.raises(Exception) as e:
        sL.simpleTestFunction(1, '2')
    assert 'TypeError' in str(e)