'Parsing House vote'

def test_house_parsing(self):

    'This    will    run    the    parser    over    any    *house.pdf    in    the    testData    folder\n                                            If    vote    is    in    the    voteKey,    it    will    also    do    an    additional    check,\n                                            otherwise    the    only    test    being    done    is    the    sanity    check    in    the    parser'
    voteKey = {'2017_vote_senate.pdf': {'other_count': 1, '_type': 'vote', 'chamber': 'upper', 'yes_count': 39, 'yes_votes': ['CANDELARIA', 'PINTO', 'LOPEZ', 'SOULES', 'BACA', 'ORTIZ    y    PINO', 'INGLE', 'SAPIEN', 'CERVANTES', 'PIRTLE', u'MU\xd1OZ', 'WHITE', 'MARTINEZ', 'STEFANICS', 'PADILLA', 'NEVILLE', 'WIRTH', 'IVEY-SOTO', 'SHARER', 'CISNEROS', 'RODRIGUEZ', 'McSORLEY', 'STEINBORN', 'BURT', 'PAPEN', 'KERNAN', 'SHENDO', "O'NEILL", 'GOULD', 'RUE', 'STEWART', 'CAMPOS', 'PAYNE', 'LEAVELL', 'SMITH', 'GRIGGS', 'SANCHEZ', 'MORALES', 'TALLMAN'], 'other_votes': ['MOORES'], 'motion': 'senate    passage', 'sources': [{'url': '2017_vote_senate.pdf'}], 'date': datetime.datetime(2017, 1, 18, 0, 0), 'type': 'other', 'no_count': 2, 'no_votes': ['BRANDT', 'WOODS'], 'passed': True}}
    testData = os.path.join(here, 'testData')
    pdfs = [f for f in os.listdir(testData) if (('house' in f) and ('.pdf' in f))]
    for pdf in pdfs:
        shutil.copy(os.path.join(testData, pdf), os.path.join(self.tmp, pdf))
        hv_text = self.nmBillScraper.scrape_vote(os.path.join(self.tmp, pdf), True)
        vote = self.nmBillScraper.parse_house_vote(hv_text, pdf)
        ok_(vote, 'Vote    returned    empty    or    did    not    complete')
        if (pdf in voteKey):
            eq_(vote, voteKey[pdf], ('%s    Vote    results    did    not    match    up    with    redefined    key' % pdf))
