<s> """<STR_LIT>""" <EOL> from hamcrest import assert_that , is_not <EOL> from mockito import any , mock , verify , when <EOL> from pyherc . ports . magic import SpellCastingParameters <EOL> from pyherc . test . builders import ( ActionFactoryBuilder , <EOL> SpellCastingFactoryBuilder , <EOL> SpellGeneratorBuilder ) <EOL> class TestSpellCastingFactory : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> def test_creating_action ( self ) : <EOL> """<STR_LIT>""" <EOL> spell_factory = mock ( ) <EOL> when ( spell_factory ) . build ( ) . thenReturn ( spell_factory ) <EOL> when ( spell_factory ) . create_spell ( any ( ) , any ( ) ) . thenReturn ( [ mock ( ) ] ) <EOL> spell_factory . spell_list = { '<STR_LIT>' : mock ( ) } <EOL> action_factory = ( ActionFactoryBuilder ( ) <EOL> . with_spellcasting_factory ( <EOL> SpellCastingFactoryBuilder ( ) <EOL> . with_spell_factory ( spell_factory ) <EOL> . build ( ) ) <EOL> . build ( ) ) <EOL> action = action_factory . get_action ( SpellCastingParameters ( self , <EOL> direction = <NUM_LIT:1> , <EOL> spell_name = '<STR_LIT>' ) ) <EOL> assert_that ( action , is_not ( None ) ) </s>
