Ejemplo n.º 1
0
def test_vfield():
    F = vfield("f", QQ)
    assert f == F.gens[0]

    F = vfield("fb fbb fcc fzz _fx", QQ)
    assert fb == F.gens[0]
    assert fbb == F.gens[1]
    assert fcc == F.gens[2]
    assert fzz == F.gens[3]
    assert _fx == F.gens[4]

    F = vfield(['fd', 'fe', 'ffg'], QQ)
    assert fd == F.gens[0]
    assert fe == F.gens[1]
    assert ffg == F.gens[2]

    # see if vfield() really injects into global namespace
    pytest.raises(NameError, lambda: f1)
    F = _make_f1()
    assert f1 == F.gens[0]

    pytest.raises(NameError, lambda: f2)
    F = _make_f2()
    assert f2 == F.gens[0]
Ejemplo n.º 2
0
def test_vfield():
    F = vfield("f", QQ)
    assert f == F.gens[0]

    F = vfield("fb fbb fcc fzz _fx", QQ)
    assert fb == F.gens[0]
    assert fbb == F.gens[1]
    assert fcc == F.gens[2]
    assert fzz == F.gens[3]
    assert _fx == F.gens[4]

    F = vfield(['fd', 'fe', 'ffg'], QQ)
    assert fd == F.gens[0]
    assert fe == F.gens[1]
    assert ffg == F.gens[2]

    # see if vfield() really injects into global namespace
    pytest.raises(NameError, lambda: f1)
    F = _make_f1()
    assert f1 == F.gens[0]

    pytest.raises(NameError, lambda: f2)
    F = _make_f2()
    assert f2 == F.gens[0]
Ejemplo n.º 3
0
def __make_f2():
    return vfield("f2", QQ)
Ejemplo n.º 4
0
def _make_f1():
    return vfield("f1", QQ)
Ejemplo n.º 5
0
def __make_f2():
    return vfield("f2", QQ)
Ejemplo n.º 6
0
def _make_f1():
    return vfield("f1", QQ)