Example #1
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
Example #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
Example #3
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