def test_invalid(self):
        """
        Sentences with a bad checksum raise L{base.InvalidChecksum} when
        attempting to validate them.
        """
        validate = nmea._validateChecksum

        bareSentence, checksum = GPGGA.split(b"*")
        badChecksum = intToBytes(int(checksum, 16) + 1)
        sentences = [bareSentence + b"*" + badChecksum]

        for s in sentences:
            self.assertRaises(base.InvalidChecksum, validate, s)

        Sentences with a bad checksum raise L{base.InvalidChecksum} when
        attempting to validate them.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/positioning/test/test_nmea.py