class TestMergeIntervals(unittest.TestCase): def setUp(self): self.solution = Solution() def test_divide(self): a = 10 b = 3 self.assertEqual(self.solution.divide(a, b), 3) a = 9 b = -2 self.assertEqual(self.solution.divide(a, b), -4) self.assertEqual(self.solution.divide(b, a), 0) a = 2 self.assertEqual(self.solution.divide(b, a), -1) a = -2147483648 b = 2 self.assertEqual(self.solution.divide(a, b), -1073741824)
import pytest from divide import Solution, Solution2 solution_list = [Solution(), Solution2()] # testcases: List[Tuple[inp, out]] # use `set` to indicate the expected output may be multiple data = [ ( (15, 2), 7, ), ( (7, -3), -2, ), ( (0, 1), 0, ), ( (1, 1), 1, ), ( (-1, -1), 1, ), ( (-2147483648, -1),
def setUp(self): self.solution = Solution()
from divide import Solution sln = Solution() print("TestCase1: ", (sln.divide(7, -3) == -2)) print("TestCase2: ", (sln.divide(7, -3) == -2))