def test_div(): instance = Math() assert instance.div(2, 1) == 2
def test_mul(): math0 = Math(value=3) math1 = Math(value=2) assert math0 * math1 == Math(value=6)
def setUp(self): self.Math = Math()
from pytest import mark from src.math import Math sum_params = ( (Math(value=1), Math(value=2), Math(value=3)), (Math(value=1), 2, Math(value=3)), ) @mark.parametrize('value0, value1, result', sum_params) def test_sum(value0, value1, result): assert value0 + value1 == result def test_sub(): math0 = Math(value=3) math1 = Math(value=1) assert math0 - math1 == Math(value=2) def test_mul(): math0 = Math(value=3) math1 = Math(value=2) assert math0 * math1 == Math(value=6)
def test_sub(): math0 = Math(value=3) math1 = Math(value=1) assert math0 - math1 == Math(value=2)
def test_addition(self): # Make test fail c = Math() self.assertEqual(c.addition(4, 4), 9)
def test_fibonacci(): actual = Math().generate_fibonacci(11) expected = 89 assert actual == expected, 'Actual value {} is different from Expected {} for number 11'.format( actual, expected)
def main(self): Math().facultyUser()
def testFaculty4(self): x = 4 result = 24 self.assertEqual(Math().faculty(x), result)
def testFaculty6(self): x = 6 result = 720 self.assertEqual(Math().faculty(x), result)