remove trailing spaces

This commit is contained in:
Benjamin Bertrand
2016-02-13 06:29:26 +03:00
parent 52ff23a749
commit b260c838df
29 changed files with 165 additions and 165 deletions

View File

@@ -28,5 +28,5 @@ def test_gcd_neg():
# -----------------------------
# Reglages pour 'vim'
# vim:set autoindent expandtab tabstop=4 shiftwidth=4:
# cursor: 16 del
# cursor: 16 del

View File

@@ -70,11 +70,11 @@ def test_mul_exp():
def test_neg_exp():
e = Expression("12- 4")
g = -e
g = -e
assert g.postfix_tokens == [12, 4, '-', '-']
# -----------------------------
# Reglages pour 'vim'
# vim:set autoindent expandtab tabstop=4 shiftwidth=4:
# cursor: 16 del
# cursor: 16 del

View File

@@ -80,7 +80,7 @@ class TestFraction(unittest.TestCase):
f = Fraction(2, 3)
ans = "\\frac{ 2 }{ 3 }"
self.assertEqual(f.__tex__(), ans)
def test_txt(self):
f = Fraction(2, 3)
ans = "2 / 3"
@@ -92,4 +92,4 @@ if __name__ == '__main__':
# -----------------------------
# Reglages pour 'vim'
# vim:set autoindent expandtab tabstop=4 shiftwidth=4:
# cursor: 16 del
# cursor: 16 del

View File

@@ -66,11 +66,11 @@ class TestGeneric(unittest.TestCase):
if __name__ == '__main__':
unittest.main()
# -----------------------------
# Reglages pour 'vim'
# vim:set autoindent expandtab tabstop=4 shiftwidth=4:
# cursor: 16 del
# cursor: 16 del

View File

@@ -84,5 +84,5 @@ def test_pw_render_txt():
# -----------------------------
# Reglages pour 'vim'
# vim:set autoindent expandtab tabstop=4 shiftwidth=4:
# cursor: 16 del
# cursor: 16 del

View File

@@ -185,5 +185,5 @@ if __name__ == '__main__':
# -----------------------------
# Reglages pour 'vim'
# vim:set autoindent expandtab tabstop=4 shiftwidth=4:
# cursor: 16 del
# cursor: 16 del

View File

@@ -27,5 +27,5 @@ if __name__ == '__main__':
# -----------------------------
# Reglages pour 'vim'
# vim:set autoindent expandtab tabstop=4 shiftwidth=4:
# cursor: 16 del
# cursor: 16 del

View File

@@ -14,8 +14,8 @@ def test_only_form():
assert rdExp._2replaced == {'a'}
rdExp()
assert set(rdExp._gene_varia.keys()) == {'a'}
assert set(rdExp._gene_2replaced.keys()) == {'a'}
assert set(rdExp._gene_varia.keys()) == {'a'}
assert set(rdExp._gene_2replaced.keys()) == {'a'}
def test_form_with_underscores():
form = "_ + 2*_"
@@ -25,8 +25,8 @@ def test_form_with_underscores():
assert rdExp._2replaced == {'A', 'B'}
rdExp()
assert set(rdExp._gene_varia.keys()) == {'A', 'B'}
assert set(rdExp._gene_2replaced.keys()) == {'A', 'B'}
assert set(rdExp._gene_varia.keys()) == {'A', 'B'}
assert set(rdExp._gene_2replaced.keys()) == {'A', 'B'}
def test_only_form_calc():
form = "{a+b} + 2"
@@ -36,8 +36,8 @@ def test_only_form_calc():
assert rdExp._2replaced == {'a+b'}
rdExp()
assert set(rdExp._gene_varia.keys()), {'a' == 'b'}
assert set(rdExp._gene_2replaced.keys()) == {'a+b'}
assert set(rdExp._gene_varia.keys()), {'a' == 'b'}
assert set(rdExp._gene_2replaced.keys()) == {'a+b'}
def test_only_form_cond():
form = "{a} + 2"
@@ -48,8 +48,8 @@ def test_only_form_cond():
assert rdExp._2replaced == {'a'}
rdExp()
assert set(rdExp._gene_varia.keys()) == {'a'}
assert set(rdExp._gene_2replaced.keys()) == {'a'}
assert set(rdExp._gene_varia.keys()) == {'a'}
assert set(rdExp._gene_2replaced.keys()) == {'a'}
assert rdExp._gene_varia['a'] == 3
@@ -62,8 +62,8 @@ def test_only_form_conds():
assert rdExp._2replaced == {'a'}
rdExp()
assert set(rdExp._gene_varia.keys()) == {'a'}
assert set(rdExp._gene_2replaced.keys()) == {'a'}
assert set(rdExp._gene_varia.keys()) == {'a'}
assert set(rdExp._gene_2replaced.keys()) == {'a'}
assert rdExp._gene_varia['a'] in list(range(5))
assert rdExp._gene_varia['a'] % 2 == 1
@@ -77,8 +77,8 @@ def test_only_form_calc_cond():
assert rdExp._2replaced, {'a', 'b' == 'a*3'}
rdExp()
assert set(rdExp._gene_varia.keys()), {'a' == 'b'}
assert set(rdExp._gene_2replaced.keys()), {'a', 'b' == 'a*3'}
assert set(rdExp._gene_varia.keys()), {'a' == 'b'}
assert set(rdExp._gene_2replaced.keys()), {'a', 'b' == 'a*3'}
assert rdExp._gene_varia['a'] == 3
@@ -91,8 +91,8 @@ def test_only_form_calc_cond_calc():
assert rdExp._2replaced, {'b', 'a*3' == 'a+b'}
rdExp()
assert set(rdExp._gene_varia.keys()), {'a' == 'b'}
assert set(rdExp._gene_2replaced.keys()), {'b', 'a*3' == 'a+b'}
assert set(rdExp._gene_varia.keys()), {'a' == 'b'}
assert set(rdExp._gene_2replaced.keys()), {'b', 'a*3' == 'a+b'}
assert (rdExp._gene_varia['a'] + rdExp._gene_varia['b']) == 3
@@ -101,5 +101,5 @@ def test_only_form_calc_cond_calc():
# -----------------------------
# Reglages pour 'vim'
# vim:set autoindent expandtab tabstop=4 shiftwidth=4:
# cursor: 16 del
# cursor: 16 del

View File

@@ -20,8 +20,8 @@ def mass_poly_test(operation, rg= 5):
:rg: number of potential values for coefs
:returns: @todo
"""
coefs_p = [[(i-2),(j-2)] for i,j in permutations(range(rg),2)]
coefs_q = [[2*(i-2),2*(j-2)] for i,j in permutations(range(rg),2)]
coefs_p = [[(i-2),(j-2)] for i,j in permutations(range(rg),2)]
coefs_q = [[2*(i-2),2*(j-2)] for i,j in permutations(range(rg),2)]
l_p = [Polynom(i) for i in coefs_p]
l_q = [Polynom(i) for i in coefs_q]
return [Expression([l_p[i],l_q[j],op.get_op(operation)]) for i,j in permutations(range(len(coefs_p)),2)]
@@ -306,5 +306,5 @@ if __name__ == '__main__':
# -----------------------------
# Reglages pour 'vim'
# vim:set autoindent expandtab tabstop=4 shiftwidth=4:
# cursor: 16 del
# cursor: 16 del

View File

@@ -13,20 +13,20 @@ class TestStr2tokens(unittest.TestCase):
def test_str2intokens(self):
ans = str2in_tokens("2+3*4")
self.assertEqual(ans, [2, "+", 3, "*", 4])
ans = str2in_tokens("2*3+4")
self.assertEqual(ans, [2, "*", 3, "+", 4])
def test_in2post_fix(self):
in_tokens = str2in_tokens("2+3*4")
ans = in2post_fix(in_tokens)
self.assertEqual(ans, [2, 3, 4, "*", "+"])
in_tokens = str2in_tokens("2*3+4")
ans = in2post_fix(in_tokens)
self.assertEqual(ans, [2, 3,"*", 4, "+"])
# TODO: Ajouter des tests pour les cas particuliers... |sam. nov. 8 17:39:18 CET 2014
def test_str2in_tokens_big_num(self):
@@ -82,5 +82,5 @@ if __name__ == '__main__':
# -----------------------------
# Reglages pour 'vim'
# vim:set autoindent expandtab tabstop=4 shiftwidth=4:
# cursor: 16 del
# cursor: 16 del