def test_get_serial(self):
        expected = 'XYZABC'
        mock = MagicMock(return_value='CertInfo\r\nSerial: XYZABC\r\nOtherStuff')
        with patch.dict(certutil.__salt__, {'cmd.run': mock}):
            out = certutil.get_cert_serial('/path/to/cert.cer')
            mock.assert_called_once_with('certutil.exe -verify /path/to/cert.cer')
            self.assertEqual(expected, out)
Test getting the serial number from a certificate
dataset/ETHPy150Open saltstack/salt/tests/unit/modules/win_certutil_test.py/CertUtilTestCase.test_get_serial