VaKeR CYBER ARMY
Logo of a company Server : Apache/2.4.41 (Ubuntu)
System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Directory :  /usr/local/lib/python3.6/dist-packages/sympy/polys/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/local/lib/python3.6/dist-packages/sympy/polys/tests/test_injections.py
"""Tests for functions that inject symbols into the global namespace. """

from sympy.polys.rings import vring
from sympy.polys.fields import vfield
from sympy.polys.domains import QQ

def test_vring():
    ns = {'vring':vring, 'QQ':QQ}
    exec('R = vring("r", QQ)', ns)
    exec('assert r == R.gens[0]', ns)

    exec('R = vring("rb rbb rcc rzz _rx", QQ)', ns)
    exec('assert rb == R.gens[0]', ns)
    exec('assert rbb == R.gens[1]', ns)
    exec('assert rcc == R.gens[2]', ns)
    exec('assert rzz == R.gens[3]', ns)
    exec('assert _rx == R.gens[4]', ns)

    exec('R = vring(["rd", "re", "rfg"], QQ)', ns)
    exec('assert rd == R.gens[0]', ns)
    exec('assert re == R.gens[1]', ns)
    exec('assert rfg == R.gens[2]', ns)

def test_vfield():
    ns = {'vfield':vfield, 'QQ':QQ}
    exec('F = vfield("f", QQ)', ns)
    exec('assert f == F.gens[0]', ns)

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

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

VaKeR 2022