1
# dpkg_status.py - compact the dpkg status file
2
# Copyright (C) 2009 Canonical, Ltd.
4
# Author: Michael Vogt <mvo@ubuntu.com>
6
# This program is free software: you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation, version 3 of the License.
10
# This program is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
15
# You should have received a copy of the GNU General Public License
16
# along with this program. If not, see <http://www.gnu.org/licenses/>.
19
from __future__ import absolute_import
25
from .dpkg_status_plugin import DpkgStatusPlugin
28
class AutoRemovalPluginTests(unittest.TestCase):
31
fd, self.fname = tempfile.mkstemp()
32
os.write(fd, "Status: purge ok not-installed\n")
34
self.plugin = DpkgStatusPlugin(self.fname)
39
def testDpkgStatus(self):
40
names = [cruft.get_name() for cruft in self.plugin.get_cruft()]
41
self.assertEqual(sorted(names), sorted([u"dpkg-status:Obsolete entries in dpkg status"]))