Exemplo n.º 1
0
 def test_list_to_string_returns_numbers_with_commas(self):
     the_list = [-1234567, 1234567]
     self.assertEqual(ti.list_to_string(the_list), '(-1,234,567), 1,234,567')
Exemplo n.º 2
0
 def test_list_to_string_returns_values_separated_by_commas(self):
     the_list = [-5, -4, -3, -1, 0, 1, 2, 3, 5]
     self.assertEqual(ti.list_to_string(the_list), '(-5)-(-3), (-1)-3, 5')
Exemplo n.º 3
0
 def test_list_to_string_puts_parentheses_around_negative_numbers(self):
     self.assertEqual(ti.list_to_string([-1]), '(-1)')
Exemplo n.º 4
0
 def test_list_to_string_returns_proper_output_for_a_run_of_numbers(self):
     self.assertEqual(ti.list_to_string([1, 1, 2, 3, 4, 5]), '1-5')
Exemplo n.º 5
0
 def test_list_to_string_returns_single_number(self):
     self.assertEqual(ti.list_to_string([1, 1, 1]), '1')