Exemple #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)
Exemple #2
0
 def test_get_next_selection_str_index_on_list(self):
     self.assertEqual(Argument._get_next_selection(['a', 1, '2', 'something'], '3'), 'something')
Exemple #3
0
 def test_get_next_selection_index_on_dict(self):
     with self.assertRaises(KeyError):
         Argument._get_next_selection({'a': 1, '2': 'something'}, 3)
Exemple #4
0
 def test_get_next_selection_key_on_value(self):
     with self.assertRaises(ValueError):
         Argument._get_next_selection('something', 'a')
Exemple #5
0
 def test_get_next_selection_key_on_list(self):
     with self.assertRaises(ValueError):
         Argument._get_next_selection(['a', 1, '2', 'something'], 'a')
Exemple #6
0
 def test_get_next_selection_key_on_dict(self):
     self.assertEqual(Argument._get_next_selection({'a': 1, '2': 'something'}, 'a'), 1)