def test_plugin_static_map(self):
        """"""
        mock_app_dir = mock.MockDir({"plugins": {"plugin1": {"templates": {}, "static": {}}}})
        mock_app = mock.MockApp(mock_app_dir.root_path)
        plugin_mgr = PageServingPluginManager(mock_app, "test", directories_setting="plugins")

        app_path = mock_app_dir.root_path
        expected_plugins_path = os.path.join(app_path, "plugins")
        self.assertItemsEqual(plugin_mgr.plugins.keys(), ["plugin1"])
        plugin = plugin_mgr.plugins["plugin1"]
        self.assertEqual(plugin_mgr.get_static_urls_and_paths(), [(plugin.static_url, plugin.static_path)])

        mock_app_dir.remove()
Example #2
0
    def test_plugin_static_map(self):
        """"""
        mock_app_dir = galaxy_mock.MockDir({
            'plugins': {
                'plugin1': {
                    'templates': {},
                    'static': {}
                }
            }
        })
        mock_app = galaxy_mock.MockApp(root=mock_app_dir.root_path)
        plugin_mgr = PageServingPluginManager(mock_app, 'test', directories_setting='plugins')

        self.assertEqual(list(plugin_mgr.plugins.keys()), ['plugin1'])
        plugin = plugin_mgr.plugins['plugin1']
        self.assertEqual(plugin_mgr.get_static_urls_and_paths(), [(plugin.static_url, plugin.static_path)])

        mock_app_dir.remove()
Example #3
0
    def test_plugin_static_map( self ):
        """"""
        mock_app_dir = mock.MockDir({
            'plugins'   : {
                'plugin1'   : {
                    'templates' : {},
                    'static'    : {}
                }
            }
        })
        mock_app = mock.MockApp( mock_app_dir.root_path )
        plugin_mgr = PageServingPluginManager( mock_app, 'test', directories_setting='plugins' )

        app_path = mock_app_dir.root_path
        expected_plugins_path = os.path.join( app_path, 'plugins' )
        self.assertItemsEqual( plugin_mgr.plugins.keys(), [ 'plugin1' ] )
        plugin = plugin_mgr.plugins[ 'plugin1' ]
        self.assertEqual( plugin_mgr.get_static_urls_and_paths(), [( plugin.static_url, plugin.static_path )] )

        mock_app_dir.remove()