Пример #1
0
 def test_eq_deg2_float_False(self):
     # Arrange
     firstPol = Polynome([5])
     secondPol = float(3.1)
     # Act
     eq = firstPol.__eq__(secondPol)
     # Assert
     self.assertFalse(eq)
Пример #2
0
 def test_eq_deg2_deg2_True(self):
     # Arrange
     firstPol = Polynome([9, 1, -9])
     secondPol = Polynome([9, 1, -9])
     # Act
     eq = firstPol.__eq__(secondPol)
     # Assert
     self.assertTrue(eq)
Пример #3
0
 def test_eq_deg2_float_True(self):
     # Arrange
     firstPol = Polynome([4.8])
     secondPol = float(4.8)
     # Act
     eq = firstPol.__eq__(secondPol)
     # Assert
     self.assertTrue(eq)
Пример #4
0
 def test_eq_deg2_int_True(self):
     # Arrange
     firstPol = Polynome([5])
     secondPol = int(5)
     # Act
     eq = firstPol.__eq__(secondPol)
     # Assert
     self.assertTrue(eq)
Пример #5
0
 def test_eq_deg2_deg2_other_coeffs_False(self):
     # Arrange
     firstPol = Polynome([9, 1, -9])
     secondPol = Polynome([18, -2, -79])
     # Act
     eq = firstPol.__eq__(secondPol)
     # Assert
     self.assertFalse(eq)
Пример #6
0
 def test_eq_deg3_deg2_False(self):
     # Arrange
     firstPol = Polynome([4, 3, 2, -1])
     secondPol = Polynome([3, 2, -1])
     # Act
     eq = firstPol.__eq__(secondPol)
     # Assert
     self.assertFalse(eq)
Пример #7
0
 def test_eq_deg2_string_exception_other_isnt_polynom(self):
     # Arrange
     firstPol = Polynome([-8, -2, -1])
     secondPol = 'string'
     # Act
     with self.assertRaises(Exception) as context:
         eq = firstPol.__eq__(secondPol)
     # Assert
     self.assertTrue("Second polynome don't exist." in str(context.exception))