def test_out_of_range(self):
        def _seek(offset, whence):
            # seek must be called with 0, 0 to find the beginning of the range
            self.assertEqual(offset, 0)
            self.assertEqual(whence, 0)
            # set offsets to something different
            self.consumer.offsets = {self.partition: 100}

        with patch.object(self.consumer, "seek", _seek):
            with self.context:
                raise OffsetOutOfRangeError()

        self.assertEqual(self.consumer.offsets, {self.partition: 100})
Should reset to beginning of valid offsets on `OffsetOutOfRangeError`
dataset/ETHPy150Open dpkp/kafka-python/test/test_context.py/TestOffsetCommitContext.test_out_of_range