def test_explain_attr_functional_pseudoelement(self):
     pseudo = parse_selector('::attr(href)', 'pseudo')
     noun = explain_pseudo(pseudo)
     self.assertEqual(
         str(realiser.realise(noun)),
         'the value of the \'href\' attribute'
     )
 def test_explain_unknown_pseudoelement_with_simple_default(self):
     pseudo = parse_selector('::cheese', 'pseudo')
     noun = explain_pseudo(pseudo)
     self.assertEqual(
         str(realiser.realise(noun)),
         'content that matches the pseudo-element \'::cheese\''
     )
 def test_explain_pseudoelement(self):
     pseudo = parse_selector('::before', 'pseudo')
     noun = explain_pseudo(pseudo)
     self.assertEqual(
         str(realiser.realise(noun)),
         'generated content before the element\'s content'
     )
 def test_explain_unknown_functional_pseudoclass_with_simple_default(self):
     pseudo = parse_selector(':ath-child(4n)', 'pseudo')
     clause = explain_pseudo(pseudo)
     self.assertEqual(
         str(realiser.realise(clause)),
         'satisfies the function \'ath-child(4n)\''
     )
 def test_explain_property_pseudoclass(self):
     pseudo = parse_selector(':checked', 'pseudo')
     clause = explain_pseudo(pseudo)
     self.assertEqual(
         str(realiser.realise(clause)),
         'is checked'
     )
Example #6
0
 def test_explain_pseudoelement(self):
     pseudo = parse_selector('::before', 'pseudo')
     noun = explain_pseudo(pseudo)
     self.assertEqual(str(realiser.realise(noun)),
                      'generated content before the element\'s content')
Example #7
0
 def test_explain_unknown_functional_pseudoclass_with_simple_default(self):
     pseudo = parse_selector(':ath-child(4n)', 'pseudo')
     clause = explain_pseudo(pseudo)
     self.assertEqual(str(realiser.realise(clause)),
                      'satisfies the function \'ath-child(4n)\'')
Example #8
0
 def test_explain_property_pseudoclass(self):
     pseudo = parse_selector(':checked', 'pseudo')
     clause = explain_pseudo(pseudo)
     self.assertEqual(str(realiser.realise(clause)), 'is checked')
Example #9
0
 def test_explain_text_pseudoelement(self):
     pseudo = parse_selector('::text', 'pseudo')
     noun = explain_pseudo(pseudo)
     self.assertEqual(str(realiser.realise(noun)), 'text content')
Example #10
0
 def test_explain_attr_functional_pseudoelement(self):
     pseudo = parse_selector('::attr(href)', 'pseudo')
     noun = explain_pseudo(pseudo)
     self.assertEqual(str(realiser.realise(noun)),
                      'the value of the \'href\' attribute')
Example #11
0
 def test_explain_unknown_pseudoelement_with_simple_default(self):
     pseudo = parse_selector('::cheese', 'pseudo')
     noun = explain_pseudo(pseudo)
     self.assertEqual(
         str(realiser.realise(noun)),
         'content that matches the pseudo-element \'::cheese\'')
 def test_explain_text_pseudoelement(self):
     pseudo = parse_selector('::text', 'pseudo')
     noun = explain_pseudo(pseudo)
     self.assertEqual(str(realiser.realise(noun)), 'text content')