def _get_exception_message(self, value): except_msg = '' try: result = string_to_long(value) except ValueError, ex: except_msg = ex.message
def test_number_string_without_sign(self): expect = 123456 result = string_to_long('123456') self.assertEqual(result, expect)
def test_number_string_with_a_space_character_as_prefix(self): expect = 123456 result = string_to_long(' 123456') self.assertEqual(result, expect)
def test_number_string_with_negative_sign(self): expect = -654321 result = string_to_long('-654321') self.assertEqual(result, expect)
def test_number_string_equal_zero(self): expect = 0 result = string_to_long('0') self.assertEqual(result, expect)