def test_handlebars_mod(self): self.config.include('pyramid_amdjs') from pyramid_amdjs import amd text = amd.build_init(self.request, '_') self.assertIn( '"handlebars": ' '"/_amdjs/static/lib/handlebars.runtime.js?_v=', text)
def build_init(request, specname): data = request.registry.settings['amd.debug.data'] for name, directory in data['paths']: load_dir(request.registry, name, directory) app_url = request.application_url app_url_len = len(app_url) js = [] for name, info in data['mods'].items(): url = '%s' % request.static_url( info['fname'], _query={'_v': info['md5']}) if url.startswith(app_url): url = url[app_url_len:] js.append('"%s": "%s"' % (name, url)) return amd.build_init(request, '_', js)
def build_init(request, specname): data = request.registry.settings['amd.debug.data'] for name, directory in data['paths']: load_dir(request.registry, name, directory) app_url = request.application_url app_url_len = len(app_url) js = [] for name, info in data['mods'].items(): url = '%s' % request.static_url(info['fname'], _query={'_v': info['md5']}) if url.startswith(app_url): url = url[app_url_len:] js.append('"%s": "%s"' % (name, url)) return amd.build_init(request, '_', js)
def test_handlebars_mod(self): from pyramid_amdjs import amd text = amd.build_init(self.request, '_') self.assertIn('"handlebars": "/_amdjs/static/lib/handlebars.js?_v=', text)
def test_handlebars_mod(self): from pyramid_amdjs import amd text = amd.build_init(self.request, '_') self.assertIn( '"handlebars": "/_amdjs/static/lib/handlebars.js?_v=', text)