Ejemplo n.º 1
0
def test_1():
    subject = Keyword(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
Ejemplo n.º 2
0
def test_6_conv():
    subject = Keyword(keyword="opt1", glossary="does stuff", validator=parsers.parse_convergence, default=6)

    # subject.value = 1
    subject.require(1)
    assert subject.value == 1.0e-1
    # assert subject.has_changed is True
    assert subject.is_default() is False
Ejemplo n.º 3
0
def test_3():
    subject = Keyword(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