def test_emit_and_inject_with_default_version(self): amp_deps = AmpDependencies(test_pod) amp_deps.add('amp-anim') content = amp_deps.emit() content = amp_deps.inject(content) self.assertEqual( '<script custom-element="amp-anim" ' 'src="https://cdn.ampproject.org/v0/amp-anim-0.1.js" async></script>', content)
def test_emit_and_inject(self): amp_deps = AmpDependencies(test_pod) amp_deps.add('amp-anim', '99.9') amp_deps.add('amp-mustache', '77.7', 'template') content = amp_deps.emit() content = amp_deps.inject(content) self.assertEqual( '<script custom-element="amp-anim" ' 'src="https://cdn.ampproject.org/v0/amp-anim-99.9.js" async></script>' '<script custom-template="amp-mustache" ' 'src="https://cdn.ampproject.org/v0/amp-mustache-77.7.js" async></script>', content)