

def test_get_serial(self):
    '\n            Test getting the serial number from a certificate\n        '
    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(self, out)

dataset/ETHPy150Open saltstack/salt/tests/unit/modules/win_certutil_test.py CertUtilTestCase.test_get_serial/VarMisuse@66/155 `expected`->`self`