<s> from nose . tools import * <EOL> from exercise47 . game import Room <EOL> def test_room ( ) : <EOL> gold = Room ( "<STR_LIT>" , <EOL> """<STR_LIT>""" ) <EOL> assert_equal ( gold . name , "<STR_LIT>" ) <EOL> assert_equal ( gold . paths , { } ) <EOL> def test_room_paths ( ) : <EOL> center = Room ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> north = Room ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> south = Room ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> center . add_paths ( { '<STR_LIT>' : north , '<STR_LIT>' : south } ) <EOL> assert_equal ( center . go ( '<STR_LIT>' ) , north ) <EOL> assert_equal ( center . go ( '<STR_LIT>' ) , south ) <EOL> def test_map ( ) : <EOL> start = Room ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> west = Room ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> down = Room ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> start . add_paths ( { '<STR_LIT>' : west , '<STR_LIT>' : down } ) <EOL> west . add_paths ( { '<STR_LIT>' : start } ) <EOL> down . add_paths ( { '<STR_LIT>' : start } ) <EOL> assert_equal ( start . go ( '<STR_LIT>' ) , west ) <EOL> assert_equal ( start . go ( '<STR_LIT>' ) . go ( '<STR_LIT>' ) , start ) <EOL> assert_equal ( start . go ( '<STR_LIT>' ) . go ( '<STR_LIT>' ) , start ) </s>
