'should search in multiple directories'

def test_multiple_dirs(self):

    mock_app_dir = galaxy_mock.MockDir({'plugins': {'plugin1': {}, 'plugin2': {}, 'file1': 'blerbler'}})
    mock_abs_plugin_dir = galaxy_mock.MockDir({'plugin3': {}, 'plugin4': {}, 'file2': 'blerbler'})
    mock_app = galaxy_mock.MockApp(root=mock_app_dir.root_path)
    directories_setting = ','.join(['plugins', mock_abs_plugin_dir.root_path])
    plugin_mgr = PluginManager(mock_app, directories_setting=directories_setting)
    app_path = mock_app_dir.root_path
    expected_plugins_rel_path = os.path.join(app_path, 'plugins')
    expected_plugins_abs_path = mock_abs_plugin_dir.root_path
    self.assertEqual(sorted(plugin_mgr.directories), sorted([expected_plugins_rel_path, expected_plugins_abs_path]))
    self.assertEqual(sorted(plugin_mgr.plugins.keys()), ['plugin1', 'plugin2', 'plugin3', 'plugin4'])
    self.assertEqual(plugin_mgr.plugins['plugin1'].name, 'plugin1')
    self.assertEqual(plugin_mgr.plugins['plugin1'].path, os.path.join(expected_plugins_rel_path, 'plugin1'))
    self.assertEqual(plugin_mgr.plugins['plugin2'].name, 'plugin2')
    self.assertEqual(plugin_mgr.plugins['plugin2'].path, os.path.join(expected_plugins_rel_path, 'plugin2'))
    self.assertEqual(plugin_mgr.plugins['plugin3'].name, 'plugin3')
    self.assertEqual(plugin_mgr.plugins['plugin3'].path, os.path.join(expected_plugins_abs_path, 'plugin3'))
    self.assertEqual(plugin_mgr.plugins['plugin4'].name, 'plugin4')
    self.assertEqual(plugin_mgr.plugins['plugin4'].path, os.path.join(expected_plugins_abs_path, 'plugin4'))
