Mapytex/test/test_operator.py

34 lines
877 B
Python
Raw Normal View History

2015-03-10 10:59:35 +00:00
#!/usr/bin/env python
# encoding: utf-8
from pymath.operator import op
def test_mul_is_visible():
assert op.mul.is_visible(2,3) == True
assert op.mul.is_visible(2,-3) == True
assert op.mul.is_visible(-2,3) == True
assert op.mul.is_visible('a',2) == True
2015-03-10 13:04:04 +00:00
assert op.mul.is_visible('(2a + 1)', 2) == True
2015-03-10 10:59:35 +00:00
assert op.mul.is_visible(2, '(-2)') == True
assert op.mul.is_visible(2, '2a') == True
assert op.mul.is_visible(2, '(-2a)') == True
assert op.mul.is_visible(2, '(-2abc)') == True
assert op.mul.is_visible(2,'a') == False
assert op.mul.is_visible(2, '(2a + 1)') == False
assert op.mul.is_visible('(3x - 1)', '(2a + 1)') == False
assert op.mul.is_visible(2, '(-2x + 1)(3x + 2)') == False
# -----------------------------
# Reglages pour 'vim'
# vim:set autoindent expandtab tabstop=4 shiftwidth=4:
# cursor: 16 del