<s> """<STR_LIT>""" <EOL> from random import Random <EOL> from hamcrest import assert_that , equal_to , has_item , is_ <EOL> from mockito import mock <EOL> from pyherc . config . dsl import Catacombs , LevelConfiguration , natural_floor <EOL> from pyherc . generators . level . prototiles import FLOOR_NATURAL <EOL> class TestConfigDSL ( ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> super ( ) . __init__ ( ) <EOL> def test_level_generator_factory_config_creation ( self ) : <EOL> """<STR_LIT>""" <EOL> rooms = mock ( ) <EOL> partitioners = mock ( ) <EOL> decorators = mock ( ) <EOL> items = mock ( ) <EOL> creatures = mock ( ) <EOL> portals = mock ( ) <EOL> context = mock ( ) <EOL> config = ( LevelConfiguration ( ) <EOL> . with_rooms ( rooms ) <EOL> . with_partitioners ( partitioners ) <EOL> . with_decorators ( decorators ) <EOL> . with_items ( items ) <EOL> . with_creatures ( creatures ) <EOL> . with_portals ( portals ) <EOL> . with_contexts ( [ context ] ) <EOL> . build ( ) ) <EOL> assert_that ( config . room_generators , is_ ( equal_to ( rooms ) ) ) <EOL> assert_that ( config . level_partitioners , is_ ( equal_to ( partitioners ) ) ) <EOL> assert_that ( config . decorators , is_ ( equal_to ( decorators ) ) ) <EOL> assert_that ( config . item_adders , is_ ( equal_to ( items ) ) ) <EOL> assert_that ( config . creature_adders , is_ ( equal_to ( creatures ) ) ) <EOL> assert_that ( config . portal_adder_configurations , is_ ( equal_to ( portals ) ) ) <EOL> def test_catacombs_generator ( self ) : <EOL> """<STR_LIT>""" <EOL> rng = Random ( ) <EOL> generator = ( Catacombs ( ) <EOL> . with_ ( natural_floor ( ) ) <EOL> . located_at ( '<STR_LIT>' ) <EOL> . located_at ( '<STR_LIT>' ) <EOL> . with_ ( rng ) <EOL> . build ( ) ) <EOL> assert_that ( generator . floor_tile , is_ ( equal_to ( FLOOR_NATURAL ) ) ) <EOL> assert_that ( generator . level_types , has_item ( '<STR_LIT>' ) ) <EOL> assert_that ( generator . level_types , has_item ( '<STR_LIT>' ) ) <EOL> assert_that ( generator . rng , is_ ( equal_to ( rng ) ) ) </s>
