1
# Copyright (C) 2008-2012 Canonical, Ltd.
3
# This program is free software: you can redistribute it and/or modify it
4
# under the terms of the GNU General Public License as published by the Free
5
# Software Foundation, version 3 of the License.
7
# This program is distributed in the hope that it will be useful, but WITHOUT
8
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
# You should have received a copy of the GNU General Public License along with
13
# this program. If not, see <http://www.gnu.org/licenses/>.
15
from __future__ import absolute_import, print_function, unicode_literals
25
from janitor.plugincore.plugins.deb_plugin import DebPlugin
26
from janitor.plugincore.testing.helpers import Application
29
class DebPluginTests(unittest.TestCase):
31
self.plugin = DebPlugin()
32
self.app = Application()
33
self.plugin.set_application(self.app)
35
def test_no_cruft(self):
36
self.assertEqual(self.plugin.get_cruft(), [])
38
def test_post_cleanup_calls_commit(self):
39
self.plugin.post_cleanup()
40
self.assertTrue(self.app.commit_called)
42
def test_post_cleanup_calls_refresh(self):
43
self.plugin.post_cleanup()
44
self.assertTrue(self.app.refresh_called)