m2m模型翻译
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
949 B

6 months ago
  1. from sympy.assumptions.ask import Q
  2. from sympy.core.symbol import Symbol
  3. from sympy.assumptions.wrapper import (AssumptionsWrapper, is_infinite,
  4. is_extended_real)
  5. def test_AssumptionsWrapper():
  6. x = Symbol('x', positive=True)
  7. y = Symbol('y')
  8. assert AssumptionsWrapper(x).is_positive
  9. assert AssumptionsWrapper(y).is_positive is None
  10. assert AssumptionsWrapper(y, Q.positive(y)).is_positive
  11. def test_is_infinite():
  12. x = Symbol('x', infinite=True)
  13. y = Symbol('y', infinite=False)
  14. z = Symbol('z')
  15. assert is_infinite(x)
  16. assert not is_infinite(y)
  17. assert is_infinite(z) is None
  18. assert is_infinite(z, Q.infinite(z))
  19. def test_is_extended_real():
  20. x = Symbol('x', extended_real=True)
  21. y = Symbol('y', extended_real=False)
  22. z = Symbol('z')
  23. assert is_extended_real(x)
  24. assert not is_extended_real(y)
  25. assert is_extended_real(z) is None
  26. assert is_extended_real(z, Q.extended_real(z))