<s> from textwrap import dedent <EOL> from openrcv . formats . blt import BLTFileWriter <EOL> from openrcv . models import ContestInput <EOL> from openrcv . streams import ListResource , StringResource <EOL> from openrcv . utiltest . helpers import UnitCase <EOL> class BLTFileWriterTest ( UnitCase ) : <EOL> def test ( self ) : <EOL> contest = ContestInput ( ) <EOL> contest . name = "<STR_LIT>" <EOL> contest . candidates = [ '<STR_LIT:A>' , '<STR_LIT:B>' , '<STR_LIT:C>' ] <EOL> contest . seat_count = <NUM_LIT:1> <EOL> ballots = [ <EOL> ( <NUM_LIT:2> , ( <NUM_LIT:2> , <NUM_LIT:1> ) ) , <EOL> ( <NUM_LIT:1> , ( <NUM_LIT:2> , ) ) , <EOL> ] <EOL> contest . ballots_resource = ListResource ( ballots ) <EOL> resource = StringResource ( ) <EOL> writer = BLTFileWriter ( resource ) <EOL> writer . write_contest ( contest ) <EOL> expected = dedent ( """<STR_LIT>""" ) <EOL> self . assertEqual ( resource . contents , expected ) </s>
