def test_reverse(self): x = 123 result = reverse.Solution().reverse(x) expected_result = 321 self.assertEqual(result, expected_result)
def test_reverse(self): self.assertEqual(reverse.Solution().reverse(123), 321) self.assertEqual(reverse.Solution().reverse(-123), -321) self.assertEqual(reverse.Solution().reverse(120), 21)
def test_result_not_thirty_two_bit_v2(self): x = 1563847412 result = reverse.Solution().reverse(x) expected_result = 0 self.assertEqual(result, expected_result)
def test_result_not_thirty_two_bit(self): x = 1534236469 result = reverse.Solution().reverse(x) expected_result = 0 self.assertEqual(result, expected_result)
def test_negative_with_zero(self): x = -120 result = reverse.Solution().reverse(x) expected_result = -21 self.assertEqual(result, expected_result)
def test_negative(self): x = -123 result = reverse.Solution().reverse(x) expected_result = -321 self.assertEqual(result, expected_result)
def test_negative_not_thirty_two_bit(self): x = -2**32 result = reverse.Solution().reverse(x) expected_result = 0 self.assertEqual(result, expected_result)