Ejemplo n.º 1
0
 def test_seperated_numbers_and_alphabetic_characters(self):
     char = "0\na\n1\nb\n3"
     numbers, errors = read_numbers_from_string(char)
     self.assertEqual(numbers, [0, 1, 3])
     self.assertEqual(errors, [generate_error("a"), generate_error("b")])
Ejemplo n.º 2
0
 def test_empty_string(self):
     numbers, errors = read_numbers_from_string("")
     self.assertEqual(numbers, [])
     self.assertEqual(errors, [])
Ejemplo n.º 3
0
 def test_two_seperated_alphabetic_characters(self):
     char = "a\nb"
     numbers, errors = read_numbers_from_string(char)
     self.assertEqual(numbers, [])
     self.assertEqual(errors, [generate_error("a"), generate_error("b")])
Ejemplo n.º 4
0
 def test_one_alphabetic_character(self):
     char = "a"
     numbers, errors = read_numbers_from_string(char)
     self.assertEqual(numbers, [])
     self.assertEqual(errors, [generate_error(char)])
Ejemplo n.º 5
0
 def test_two_seperated_numbers_with_spacing(self):
     char = "0 \n1 "
     numbers, errors = read_numbers_from_string(char)
     self.assertEqual(numbers, [0, 1])
     self.assertEqual(errors, [])
Ejemplo n.º 6
0
 def test_single_number(self):
     numbers, errors = read_numbers_from_string("0")
     self.assertEqual(numbers, [0])
     self.assertEqual(errors, [])