Exemplo n.º 1
0
 def test_get_next_selection_index_on_list_out_of_bounds(self):
     with self.assertRaises(IndexError):
         Argument._get_next_selection(['a', 1, '2', 'something'], 10)
Exemplo n.º 2
0
 def test_get_next_selection_str_index_on_list(self):
     self.assertEqual(Argument._get_next_selection(['a', 1, '2', 'something'], '3'), 'something')
Exemplo n.º 3
0
 def test_get_next_selection_index_on_dict(self):
     with self.assertRaises(KeyError):
         Argument._get_next_selection({'a': 1, '2': 'something'}, 3)
Exemplo n.º 4
0
 def test_get_next_selection_key_on_value(self):
     with self.assertRaises(ValueError):
         Argument._get_next_selection('something', 'a')
Exemplo n.º 5
0
 def test_get_next_selection_key_on_list(self):
     with self.assertRaises(ValueError):
         Argument._get_next_selection(['a', 1, '2', 'something'], 'a')
Exemplo n.º 6
0
 def test_get_next_selection_key_on_dict(self):
     self.assertEqual(Argument._get_next_selection({'a': 1, '2': 'something'}, 'a'), 1)