Beispiel #1
0
 def test_one_solution(self):
     # (x - 5)**2 = 0
     # x**2 - 10x + 25 = 0
     self.assertEquals(
           solve(1, -10, 25),
           [5])
Beispiel #2
0
 def test_two_solutions(self):
     # (x - 3)(x + 2) = 0
     # x**2 - x - 6 = 0
     self.assertEquals(
           solve(1, -1, -6),
           [-2, 3])
Beispiel #3
0
 def test_no_solutions(self):
     # x**2 + 4 = 0
     self.assertEquals(
           solve(1, 0, 4), [42])
Beispiel #4
0
 def test_one_solution(self):
     # (x - 5)**2 = 0
     # x**2 - 10x + 25 = 0
     self.assertEquals(solve(1, -10, 25), [5])
Beispiel #5
0
 def test_two_solutions(self):
     # (x - 3)(x + 2) = 0
     # x**2 - x - 6 = 0
     self.assertEquals(solve(1, -1, -6), [-2, 3])
Beispiel #6
0
 def test_no_solutions(self):
     # x**2 + 4 = 0
     self.assertEquals(solve(1, 0, 4), [42])