Example #1
0
    def _get_exception_message(self, value):
        except_msg = ''

        try:
            result = string_to_long(value)
        except ValueError, ex:
            except_msg = ex.message
Example #2
0
    def _get_exception_message(self, value):
        except_msg = ''

        try:
            result = string_to_long(value)
        except ValueError, ex:
            except_msg = ex.message
Example #3
0
 def test_number_string_without_sign(self):
     expect = 123456
     result = string_to_long('123456')
     self.assertEqual(result, expect)
Example #4
0
 def test_number_string_with_a_space_character_as_prefix(self):
     expect = 123456
     result = string_to_long(' 123456')
     self.assertEqual(result, expect)
Example #5
0
 def test_number_string_with_negative_sign(self):
     expect = -654321
     result = string_to_long('-654321')
     self.assertEqual(result, expect)
Example #6
0
 def test_number_string_equal_zero(self):
     expect = 0
     result = string_to_long('0')
     self.assertEqual(result, expect)
Example #7
0
 def test_number_string_without_sign(self):
     expect = 123456
     result = string_to_long('123456')
     self.assertEqual(result, expect)
Example #8
0
 def test_number_string_with_a_space_character_as_prefix(self):
     expect = 123456
     result = string_to_long(' 123456')
     self.assertEqual(result, expect)
Example #9
0
 def test_number_string_with_negative_sign(self):
     expect = -654321
     result = string_to_long('-654321')
     self.assertEqual(result, expect)
Example #10
0
 def test_number_string_equal_zero(self):
     expect = 0
     result = string_to_long('0')
     self.assertEqual(result, expect)