Example #1
0
 def test_two_attributes(self):
     query = _make_xpath_query('descendant::text:h',
                               text_style=u"Standard",
                               outline_level=1)
     expected = ('descendant::text:h[@text:outline-level="1"]'
                 '[@text:style-name="Standard"]')
     self.assertEqual(query, expected)
 def test_two_attributes_position(self):
     query = _make_xpath_query('descendant::text:h',
             text_style=u"Standard", outline_level=1, position=1)
     expected = ('(descendant::text:h[@text:outline-level="1"]'
                 '[@text:style-name="Standard"])[2]')
     self.assertEqual(query, expected)
 def test_attribute_position(self):
     query = _make_xpath_query('descendant::text:p',
             text_style=u"Standard", position=1)
     self.assertEqual(query,
             '(descendant::text:p[@text:style-name="Standard"])[2]')
 def test_position(self):
     query = _make_xpath_query('descendant::text:h', position=1)
     self.assertEqual(query, '(descendant::text:h)[2]')
 def test_attribute(self):
     query = _make_xpath_query('descendant::text:p',
             text_style=u"Standard")
     self.assertEqual(query,
                      'descendant::text:p[@text:style-name="Standard"]')
 def test_element(self):
     query = _make_xpath_query('descendant::text:p')
     self.assertEqual(query, 'descendant::text:p')
Example #7
0
 def test_attribute_position(self):
     query = _make_xpath_query('descendant::text:p',
             text_style="Standard", position=1)
     self.assertEqual(query,
             '(descendant::text:p[@text:style-name="Standard"])[2]')
Example #8
0
 def test_position(self):
     query = _make_xpath_query('descendant::text:h', position=1)
     self.assertEqual(query, '(descendant::text:h)[2]')
Example #9
0
 def test_attribute(self):
     query = _make_xpath_query('descendant::text:p',
             text_style="Standard")
     self.assertEqual(query,
                      'descendant::text:p[@text:style-name="Standard"]')
Example #10
0
 def test_element(self):
     query = _make_xpath_query('descendant::text:p')
     self.assertEqual(query, 'descendant::text:p')