Пример #1
0
def test_calc_variable():
    with pytest.raises(AssertionError):
        # Expecting AssertionError
        # --> no variable specified
        P = PriorEngine(config='./test/prior_engine/test_config_prior.yml',
                        datestr='2017-03-01')
        P.get_priors()
Пример #2
0
def test_recent_prior():
    P = PriorEngine(config='./test/prior_engine/test_config_recent_prior.yml',
                    datestr='2017-03-01',
                    variables=['sm'])
    with pytest.raises(AssertionError,
                       match=r'.*Directory does not exist.*'):
        P.get_priors()
Пример #3
0
def test_recent_prior():
    P = PriorEngine(config='./test/prior_engine/test_config_recent_prior.yml',
                    datestr='2017-03-01',
                    variables=['sm'])
    with pytest.raises(AssertionError,
                       message=("Expecting AssertionError"),
                       match=r'.*recent.*'):
        P.get_priors()
Пример #4
0
def test_priorengine_get_priors_sand_fraction():
    P = PriorEngine(config='./test/prior_engine/test_config_prior.yml',
                    datestr='2017-03-01',
                    variables=['sand_fraction'])
    priors = P.get_priors()
    assert type(priors) is dict
    assert 'sand_fraction' in priors.keys()
Пример #5
0
def test_priorengine_get_priors_n():
    P = PriorEngine(config='./test/prior_engine/test_config_prior.yml',
                    datestr='2017-01-01',
                    variables=['n'])
    assert type(P.get_priors()) is dict