Exemplo n.º 1
0
def not_tet_matlab_runs():
    '''run_matlab_code should execute the Matlab code.'''
    fname = tempfile.mkstemp(suffix='.mat')[1]
    code = "a = 2 + 2; save('%s');" % fname
    gpml.run_matlab_code(code)
    v = scipy.io.loadmat(fname)
    os.remove(fname)
    assert v['a'] == 4
Exemplo n.º 2
0
def not_tet_matlab_runs():
    '''run_matlab_code should execute the Matlab code.'''
    fname = tempfile.mkstemp(suffix='.mat')[1]
    code = "a = 2 + 2; save('%s');" % fname
    gpml.run_matlab_code(code)
    v = scipy.io.loadmat(fname)
    os.remove(fname)
    assert v['a'] == 4
Exemplo n.º 3
0
def not_tet_matlab_stops():
    '''run_matlab_code should stop and report an error if its code causes Matlab to throw an exception.'''
    try:
        gpml.run_matlab_code("asdf")
    except Exception:
        pass
    else:
        raise AssertionError('Failure expected')
Exemplo n.º 4
0
def not_tet_matlab_stops():
    '''run_matlab_code should stop and report an error if its code causes Matlab to throw an exception.'''
    try:
        gpml.run_matlab_code("asdf")
    except Exception:
        pass
    else:
        raise AssertionError('Failure expected')