def test_extract(self):
    '\n            Test the extract() function.\n        '
    values = self.pdf.extract([('with_parent', 'LTPage[pageid="1"]'), ('with_formatter', 'text'), ('last_name', 'LTTextLineHorizontal:in_bbox("315,680,395,700")'), ('spouse', 'LTTextLineHorizontal:in_bbox("170,650,220,680")'), ('with_parent', 'LTPage[pageid="2"]'), ('oath', 'LTTextLineHorizontal:contains("perjury")', (lambda match: (match.text()[:30] + '...'))), ('year', 'LTTextLineHorizontal:contains("Form 1040A (")', (lambda match: int(match.text()[(- 5):(- 1)])))])
    self.assertDictEqual(values, {'last_name': 'Michaels', 'spouse': 'Susan R.', 'oath': u'Under penalties of perjury, I ...', 'year': 2007})
Test the extract() function.
def test_extract(self):
    '\n            \n        '
    values = self.pdf.extract([('with_parent', 'LTPage[pageid="1"]'), ('with_formatter', 'text'), ('last_name', 'LTTextLineHorizontal:in_bbox("315,680,395,700")'), ('spouse', 'LTTextLineHorizontal:in_bbox("170,650,220,680")'), ('with_parent', 'LTPage[pageid="2"]'), ('oath', 'LTTextLineHorizontal:contains("perjury")', (lambda match: (match.text()[:30] + '...'))), ('year', 'LTTextLineHorizontal:contains("Form 1040A (")', (lambda match: int(match.text()[(- 5):(- 1)])))])
    self.assertDictEqual(values, {'last_name': 'Michaels', 'spouse': 'Susan R.', 'oath': u'Under penalties of perjury, I ...', 'year': 2007})