'L{plugin.pluginPackagePaths} should exclude directories which are
Python packages.  The only allowed plugin package (the only one
associated with a I{dummy} package which Python will allow to be
imported) will already be known to the caller of
L{plugin.pluginPackagePaths} and will most commonly already be in
the C{__path__} they are about to mutate.'

def test_pluginPackagesExcluded(self):

    root = FilePath(self.mktemp())
    foo = root.child('foo').child('dummy').child('plugins')
    foo.makedirs()
    foo.child('__init__.py').setContent('')
    sys.path = [root.child('foo').path, root.child('bar').path]
    self.assertEqual(plugin.pluginPackagePaths('dummy.plugins'), [root.child('bar').child('dummy').child('plugins').path])
