def test_eq_deg2_deg3_False(self): # Arrange firstPol = Polynome([2, -1]) secondPol = Polynome([3, 2, -1]) # Act eq = firstPol.__compare__(secondPol) # Assert self.assertEqual(eq, -1)
def test_eq_deg2_string__exception_other_isnt_polynom(self): # Arrange firstPol = Polynome([5]) secondPol = "asdf" # Act with self.assertRaises(Exception) as context: eq = firstPol.__compare__(secondPol) # Assert self.assertTrue("Second polynome don't exist." in str(context.exception))