Skip to content

Commit

Permalink
Simplify the list plugins integration test (#607)
Browse files Browse the repository at this point in the history
This test has been unnecessarily painful to maintain, because every time
we add a new plugin, the format is changed. We don't need to check the format
anymore, and there is little risk of this breaking because the mechanism has been
extensively tested already.

LP: #1596114
  • Loading branch information
come-maiz authored and sergiusens committed Jun 25, 2016
1 parent da9fea7 commit 3fa8595
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions integration_tests/test_list_plugins.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015-2016 Canonical Ltd
# Copyright (C) 2015, 2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
Expand All @@ -14,15 +14,23 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import pkgutil

from snapcraft import plugins

import integration_tests

from testtools.matchers import HasLength


class ListPluginsTestCase(integration_tests.TestCase):

def test_list_plugins(self):
output = self.run_snapcraft('list-plugins')
expected = (
'ant cmake gulp kernel nil python3 tar-content\n'
'autotools copy jdk make nodejs qmake \n'
'catkin go kbuild maven python2 scons \n')
self.assertEqual(expected, output)
expected = [
module_name.replace('_', '-') for _, module_name, _ in
pkgutil.iter_modules(plugins.__path__)
]
for plugin in expected:
self.assertIn(plugin, output)
self.assertThat(output.split(), HasLength(len(expected)))

0 comments on commit 3fa8595

Please sign in to comment.