def test_add_oracle_special_cases_converter(self):
    """Tests the add_oracle converter on special cases."""
    converter = casper_converters.get_converter("add_oracle", _RETRIEVAL_INDEX,
                                                "top", {
                                                    "n": 2,
                                                    "k": 2,
                                                    "p": 1.0,
                                                }, _FORMATTER_KWARGS)

    # raw_ex is the index entry "aaa". Even when `max_exemplars` is 2, "aaa"
    # itself should not be chosen for augmentation. Note that "ccc" will be
    # chosen even though it is not among the retrievals.
    raw_ex = dict(_RETRIEVAL_INDEX[0])
    raw_ex["exemplars"] = {"hashed_ids": ["bbb", "ddd"]}
    results = list(converter.convert(raw_ex))
    self.assertLen(results, 2)
    self.assertEqual(results[0],
                     ("give me 30 seconds @@ " + _INPUT_OUTPUT_STRS["ccc"],
                      "[IN snooze alarm = [SL snooze duration = 30 seconds]]"))
    self.assertEqual(results[1], results[0])
Tests the add_oracle converter on special cases.
language/casper/augment/casper_converters_test.py