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