def test_clean_up(self):
    self.c._installed = False
    mock__systemd = mock.Mock()
    self.c._systemd = mock__systemd
    self.patch_object(self.c, 'stop', name='mock_c_stop')
    self.c.clean_up()
    self.mock_c_stop.assert_not_called()
    mock__systemd.disable.assert_not_called()
    mock__systemd.remove.assert_not_called()
    self.c._installed = True
    self.c.clean_up()
    self.mock_c_stop.assert_called_once_with()
    mock__systemd.disable.assert_called_once_with()
    mock__systemd.remove.assert_called_once_with()
def test_clean_up(self):
    self.c._installed = False
    mock__systemd = mock.Mock()
    self.c._systemd = mock__systemd
    self.patch_object(self.c, 'stop', name='mock_c_stop')
    self.c.clean_up()
    self.mock_c_stop.assert_not_called()
    mock__systemd.disable.assert_not_called()
    mock__systemd.remove.assert_not_called()
    self.c._installed = True
    self.c.clean_up()
    self.mock_c_stop.assert_called_once_with()
    mock__systemd.disable.assert_called_once_with()
    mock__systemd.remove.assert_called_once_with()