示例#1
0
def test_3():
    subject = RottenOption(keyword='opt1', glossary='does stuff', validator=validator, default=6)
    #subject.value = 10
    subject.require(10)

    assert subject.value == 10
    #assert subject.has_changed is True
    assert subject.is_default() is False
示例#2
0
def test_6_conv():
    subject = RottenOption(keyword='opt1', glossary='does stuff', validator=parsers.parse_convergence, default=6)

    #subject.value = 1
    subject.require(1)
    assert subject.value == 1.e-1
    #assert subject.has_changed is True
    assert subject.is_default() is False
示例#3
0
def test_8_conv():
    subject = RottenOption(keyword='opt1',
                           glossary='does stuff',
                           validator=parsers.parse_convergence,
                           default=6)

    with pytest.raises(qcdb.OptionValidationError):
        #subject.value = -1.0
        subject.require(-1.0)
示例#4
0
def test_1():
    subject = RottenOption(keyword='opt1', glossary='does stuff', validator=validator, default=6)
    assert subject.value == 6
    #assert subject.has_changed is False
    assert subject.is_default() is True
    assert subject.keyword == 'OPT1'

    #subject.value = 6
    subject.require(6)
    #assert subject.has_changed is True
    assert subject.is_default() is True
示例#5
0
def test_9_mem():
    subject = RottenOption(keyword='memory', default='700 mb', validator=parsers.parse_memory)

    assert subject.value == 700000000

    subject.require(800000000)
    assert subject.value == 800000000

    subject.require('.6 Gb')
    assert subject.value == 600000000

    with pytest.raises(qcdb.OptionValidationError):
        subject.require('8 dimms')