Exemplo n.º 1
0
def test_Extension_postprocess():
    opt = {"extension": set([sqrt(2)])}
    Extension.postprocess(opt)

    assert opt == {"extension": set([sqrt(2)]), "domain": QQ.algebraic_field(sqrt(2))}

    opt = {"extension": True}
    Extension.postprocess(opt)

    assert opt == {"extension": True}
Exemplo n.º 2
0
def test_Extension_postprocess():
    opt = {'extension': set([sqrt(2)])}
    Extension.postprocess(opt)

    assert opt == {
        'extension': set([sqrt(2)]),
        'domain': QQ.algebraic_field(sqrt(2)),
    }

    opt = {'extension': True}
    Extension.postprocess(opt)

    assert opt == {'extension': True}
Exemplo n.º 3
0
def test_Extension_postprocess():
    opt = {'extension': set([sqrt(2)])}
    Extension.postprocess(opt)

    assert opt == {
        'extension': set([sqrt(2)]),
        'domain': QQ.algebraic_field(sqrt(2)),
    }

    opt = {'extension': True}
    Extension.postprocess(opt)

    assert opt == {'extension': True}
Exemplo n.º 4
0
def test_Extension_preprocess():
    assert Extension.preprocess(True) is True
    assert Extension.preprocess(1) is True

    assert Extension.preprocess([]) is None

    assert Extension.preprocess(sqrt(2)) == set([sqrt(2)])
    assert Extension.preprocess([sqrt(2)]) == set([sqrt(2)])

    assert Extension.preprocess([sqrt(2), I]) == set([sqrt(2), I])

    raises(OptionError, lambda: Extension.preprocess(False))
    raises(OptionError, lambda: Extension.preprocess(0))
Exemplo n.º 5
0
def test_Extension_preprocess():
    assert Extension.preprocess(True) is True
    assert Extension.preprocess(1) is True

    assert Extension.preprocess([]) is None

    assert Extension.preprocess(sqrt(2)) == set([sqrt(2)])
    assert Extension.preprocess([sqrt(2)]) == set([sqrt(2)])

    assert Extension.preprocess([sqrt(2), I]) == set([sqrt(2), I])

    raises(OptionError, lambda: Extension.preprocess(False))
    raises(OptionError, lambda: Extension.preprocess(0))