U
    L?hO                     @   sp   d Z ddlmZmZ ddlmZmZmZ ddlm	Z	m
Z
 ddlmZ dd Zdd	 Zd
d Zdd Zdd ZdS )z&Tests for the PolynomialRing classes.     )QQZZ)ExactQuotientFailedCoercionFailedNotReversible)xy)raisesc                  C   s2   t jttdtfdtffd} | ddks.td S )Nlexilexorder)      ))r   ))r   old_poly_ringr   r   r   AssertionErrorR r   _/var/www/html/venv/lib/python3.8/site-packages/sympy/polys/domains/tests/test_polynomialring.pytest_build_order   s    r   c                     s  t tt} t tt}|t |tt|ks8tdt |ksHtddt  |ks\t|ksht d d  |ttd d  kst d |td ksttt fdd tt	fdd tt	 fdd  d    kst|
ttttttt ks$t|| t|  ks@t|| tt | d ks`t|| g|jd gkstd S )Nr      c                      s     S Nr   r   XYr   r   <lambda>       z!test_globalring.<locals>.<lambda>c                      s   t   S r   r   r   r   r   r   r      r   c                      s    t  S r   r   r   r   r   r   r      r   )r   old_frac_fieldr   r   r   convertr   r	   r   	TypeErrorfrom_GlobalPolynomialRingr   from_FractionField_sdm_to_vector_vector_to_sdmr   Qxyr   r   r   r   test_globalring   s$    

*, r,   c                	      s  t tt t jttddtttks<tdt ksLtddt  ks`tksltd d  d  ttd d  dt  kstttfdd ttfdd d td kstd  kst	t
tttt
ttks$t t ks@ttt fdd ttfd	d ttfd
d d  d   gjdd   d  gkstd S )Nr   r   r   r   c                      s   t   S r   r   r   r    r   r   r   3   r   z test_localring.<locals>.<lambda>c                      s    t  S r   r!   r   r"   r   r   r   4   r   c                      s     tt  S r   )r'   r$   r   r   r   r*   r   r   r   :   r   c                      s     S r   )Zexquor   )r   r   r   r   r   r   ;   r   c                      s
     S r   )revertr   )r   r   r   r   r   <   r   )r   r#   r   r   r   r$   r   r	   r%   r&   r   r'   r   r   r   r(   r)   r   r   r   )r+   r   r   r   r   test_localring(   s0    

:,$ r.   c                      st   t jttddt tt t t ks<t t tks\ttt fdd d S )Nr   r   c                      s      ddt  S )Nr   )r$   r   r   GLr   r   r   I   r   z!test_conversion.<locals>.<lambda>)r   r   r   r   r$   r   r	   r   r   r   r/   r   test_conversionC   s
      r2   c                  C   s&  t t} | | dst| | ds2t| | trFt| | dt r^tt jtdd} | | dst| | dst| | trt| | dt sttt} | | dst| | drt| | trt| | dt r"td S )Nr   r   r   r   )r   r   r   Zis_unitr$   r   r   r   r   r   r   
test_unitsL   s    

r3   N)__doc__Zsympy.polys.domainsr   r   Zsympy.polys.polyerrorsr   r   r   Z	sympy.abcr   r   Zsympy.testing.pytestr	   r   r,   r.   r2   r3   r   r   r   r   <module>   s   	