def process(package, output, dynamic): plugin = self.get_plugin(package.name) if dynamic: plugin_subdir = path("plugins") plugin_dir = output_dir / plugin_subdir if not plugin_dir.isdir(): plugin_dir.makedirs() plugin_filename = package.name + ".js" plugin_location = plugin_subdir / plugin_filename self._created_javascript.add(plugin_location) combine_output_path = plugin_dir / plugin_filename combine_output = combine_output_path.open("w") else: plugin_location = None combine_output = output combiner.write_metadata(output, plugin, plugin_location) combiner.combine_files(combine_output, css_file, plugin, plugin.location, exclude_tests=exclude_tests, image_path_prepend="resources/%s/" % plugin.name) if dynamic: combine_output.write("bespin.tiki.script(%s);" % dumps(plugin_filename))
def test_package_index_generation(): p = path(__file__).dirname() / "noindexapp" output = StringIO() plugin = Plugin("noindexapp", p, dict(name="testing")) combine_files(output, StringIO(), plugin, p) combined = output.getvalue() print combined assert 'tiki.module("noindexapp:index"' in combined assert 'tiki.main' not in combined