<s> import os . path <EOL> from unittest import TestCase <EOL> from openelex . us . ar . fetch import FetchResults <EOL> class TestFetchResults ( TestCase ) : <EOL> def setUp ( self ) : <EOL> tests_dir = os . path . abspath ( os . path . dirname ( __file__ ) ) <EOL> fixture_path = os . path . join ( tests_dir , '<STR_LIT>' , '<STR_LIT>' ) <EOL> with open ( fixture_path , '<STR_LIT:r>' ) as f : <EOL> self . _portal_html = f . read ( ) <EOL> self . _fetcher = FetchResults ( ) <EOL> def test_scrape_contests ( self ) : <EOL> options = self . _fetcher . _scrape_contests ( self . _portal_html ) <EOL> contest_names = [ name for ( contest_id , name ) in options ] <EOL> self . assertEqual ( len ( options ) , <NUM_LIT> ) <EOL> self . assertIn ( "<STR_LIT>" , contest_names ) <EOL> self . assertIn ( "<STR_LIT>" , contest_names ) <EOL> self . assertIn ( "<STR_LIT>" , <EOL> contest_names ) <EOL> self . assertIn ( "<STR_LIT>" , <EOL> contest_names ) </s>
