示例#1
0
 def test_on_float_valued_string(self):
     test_argument = "6.9"
     expected = None
     actual = convert_to_int(test_argument)
     assert actual == expected, "Expected: None, Actual: {0}".format(actual)
示例#2
0
 def test_on_string_with_missing_comma(self):
     test_argument = "178100,301"
     expected = None
     actual = convert_to_int(test_argument)
     assert actual == expected, "Expected: None, Actual: {0}".format(actual)
示例#3
0
 def test_on_string_with_incorrectly_placed_comma(self):
     test_argument = "12,72,891"
     expected = None
     actual = convert_to_int(test_argument)
     assert actual == expected, "Expected: None, Actual: {0}".format(actual)
示例#4
0
 def test_with_two_commas(self):
     test_argument = "1,034,891"
     expected = 1034891
     actual = convert_to_int(test_argument)
     assert actual == expected, "Expected: 1034891, Actual: {0}".format(
         actual)
示例#5
0
 def test_with_one_comma(self):
     test_argument = "2,081"
     expected = 2081
     actual = convert_to_int(test_argument)
     assert actual == expected, "Expected: 2081, Actual: {0}".format(actual)
示例#6
0
 def test_with_no_comma(self):
     test_argument = "756"
     expected = 756
     actual = convert_to_int(test_argument)
     assert actual == expected, "Expected: 756, Actual: {0}".format(actual)