Пример #1
0
 def test_one_solution(self):
     """ Resolve X^2 = 0 """
     p = Polynom(1, 0, 0)
     self.assertEqual(str(p), 'X^2')
     self.assertEqual(p.get_sol(), [0])
Пример #2
0
 def test_two_solutions(self):
     """ Resolve X^2 - X - 12 = 0 """
     p = Polynom(1, -1, -12)
     self.assertEqual(str(p), 'X^2 - X - 12')
     self.assertEqual(p.get_sol(), [-3, 4])
Пример #3
0
 def test_none_solution(self):
     """ Resolve X^2 + X + 1 = 0 """
     p = Polynom(1, 1, 1)
     self.assertEqual(str(p), 'X^2 + X + 1')
     self.assertEqual(p.get_sol(), [])