'should be able to search given rel. path'

def test_rel_path_search(self):

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