def test_stop(self):
    self.patch_object(conncheck, 'logger', name='mock_logger')
    self.c._systemd = None
    self.c.stop()
    self.mock_logger.debug.assert_called_once_with(mock.ANY, self.c)
    mock__systemd = mock.Mock()
    self.c._systemd = mock__systemd
    self.mock_logger.reset_mock()
    self.c.stop()
    mock__systemd.stop.assert_called_once_with()
def test_stop(self):
    self.patch_object(conncheck, 'logger', name='mock_logger')
    self.c._systemd = None
    self.c.stop()
    self.mock_logger.debug.assert_called_once_with(mock.ANY, self.c)
    mock__systemd = mock.Mock()
    self.c._systemd = mock__systemd
    self.mock_logger.reset_mock()
    self.c.stop()
    mock__systemd.stop.assert_called_once_with()