def test_validate_checksum_ok(self):  # pylint: disable=no-self-use
        """Test validate when a lineNumber and checksum are present, and the checksum is valid."""
        unit = GcodeParser()
        unit.text = "G28"
        unit.lineNumber = 10
        unit._checksum = 77  # pylint: disable=protected-access

        unit.validate()
    def test_validate_checksum_mismatch(self):
        """Test validate when a lineNumber and checksum are present, but the checksum is invalid."""
        unit = GcodeParser()
        unit.text = "G28"  # Checksum should be 77
        unit.lineNumber = 10
        unit._checksum = 20  # pylint: disable=protected-access

        with self.assertRaises(ValueError):
            unit.validate()