Ejemplo n.º 1
0
 def test_display_override(self):
     raw = '{{cssxref("the-foo", "foo")}}'
     ks = CSSxRef(raw=raw, args=['the-foo', 'foo'], scope=self.scope)
     self.assertEqual(
         ks.to_html(),
         ('<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/'
          'the-foo"><code>foo</code></a>'))
Ejemplo n.º 2
0
 def test_display_override(self):
     raw = '{{cssxref("the-foo", "foo")}}'
     ks = CSSxRef(raw=raw, args=['the-foo', 'foo'], scope=self.scope)
     self.assertEqual(
         ks.to_html(),
         ('<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/'
          'the-foo"><code>foo</code></a>'))
Ejemplo n.º 3
0
 def test_standard(self):
     raw = '{{cssxref("z-index")}}'
     ks = CSSxRef(raw=raw, args=['z-index'], scope=self.scope)
     self.assertEqual(ks.api_name, 'z-index')
     self.assertIsNone(ks.display_name)
     self.assertEqual(
         ks.to_html(),
         ('<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/'
          'z-index"><code>z-index</code></a>'))
     self.assertEqual(ks.issues, [])
     self.assertEqual(text_type(ks), raw)
Ejemplo n.º 4
0
 def test_standard(self):
     raw = '{{cssxref("z-index")}}'
     ks = CSSxRef(raw=raw, args=['z-index'], scope=self.scope)
     self.assertEqual(ks.api_name, 'z-index')
     self.assertIsNone(ks.display_name)
     self.assertEqual(
         ks.to_html(),
         ('<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/'
          'z-index"><code>z-index</code></a>'))
     self.assertEqual(ks.issues, [])
     self.assertEqual(text_type(ks), raw)
Ejemplo n.º 5
0
 def test_feature_name(self):
     # https://developer.mozilla.org/en-US/docs/Web/CSS/attr
     raw = '{{cssxref("content")}}'
     ks = CSSxRef(raw=raw, args=['content'], scope='compatibility feature')
     self.assertEqual(ks.to_html(), '<code>content</code>')
Ejemplo n.º 6
0
 def test_feature_name(self):
     # https://developer.mozilla.org/en-US/docs/Web/CSS/attr
     raw = '{{cssxref("content")}}'
     ks = CSSxRef(raw=raw, args=['content'], scope='compatibility feature')
     self.assertEqual(ks.to_html(), '<code>content</code>')