Пример #1
0
def test_22d():
    subjects = RottenOptions()
    subjects.add('qcdb', RottenOption(keyword='memory', default='700 mb', validator=parsers.parse_memory))
    subjects.suggest('qcdb', 'memory', 4000000000, 12342345)

    assert subjects.scroll['QCDB']['MEMORY'].value == 4000000000
    assert subjects.scroll['QCDB']['MEMORY'].is_default() is False
Пример #2
0
def test_22a():
    subjects = RottenOptions()
    subjects.add('qcdb', RottenOption(keyword='memory', default='700 mb', validator=parsers.parse_memory))
    subjects.require('qcdb', 'memory', 9000000000, 22342345)
    subjects.suggest('qcdb', 'memory', 4000000000, 12342345)
    subjects.require('qcdb', 'memory', '9 gb', '00000000')

    assert subjects.scroll['QCDB']['MEMORY'].value == 9000000000
Пример #3
0
def test_22c():
    subjects = RottenOptions()
    subjects.add('qcdb', RottenOption(keyword='memory', default='700 mb', validator=parsers.parse_memory))
    subjects.require('qcdb', 'memory', 9000000000, 22342345)
    subjects.suggest('qcdb', 'memory', 4000000000, 12342345)
    subjects.require('qcdb', 'memory', '8 gb', 555)  # no user signal so trumps 2234

    assert subjects.scroll['QCDB']['MEMORY'].value == 8000000000
    assert subjects.scroll['QCDB']['MEMORY'].is_default() is False
Пример #4
0
def test_22b():
    subjects = RottenOptions()
    subjects.add('qcdb', RottenOption(keyword='memory', default='700 mb', validator=parsers.parse_memory))
    subjects.require('qcdb', 'memory', 9000000000, 22342345)
    subjects.suggest('qcdb', 'memory', 4000000000, 12342345)
    subjects.require('qcdb', 'memory', '8 gb', '00000000')

    with pytest.raises(qcdb.OptionReconciliationError):
        assert subjects.scroll['QCDB']['MEMORY'].value == 8000000000
Пример #5
0
def test_23b():
    subjects = RottenOptions()
    subjects.add(
        'qcdb',
        RottenOption(keyword='scf_e_conv',
                     default=5,
                     validator=parsers.parse_convergence))
    subjects.suggest('qcdb', 'e_conv', 1.e-6, 1234)

    assert subjects.scroll['QCDB']['SCF_E_CONV'].value == 1.e-5