def test_requiredArgumentWithKeyMissingRaisesKeyError(self):
        """
        L{ListOf.toBox} raises C{KeyError} if the argument's key is not
        present in the objects dictionary.
        """
        stringList = amp.ListOf(amp.Integer())
        self.assertRaises(
            KeyError, stringList.toBox, b'ommited', amp.AmpBox(),
            {'someOtherKey': 0}, None)

        L{ListOf.toBox} raises C{KeyError} if the argument's key is not
        present in the objects dictionary.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_amp.py