#NEWLINE# def test_build_add_remove_ai( self ) : #NEWLINE# #INDENT# npc = self . area . new_npc ( ) #NEWLINE# message = npc . build_add_ai ( '' , self . bob ) #NEWLINE# self . assertEqual ( 'Try: "add ai <ai-pack-name>", or type "help ai packs".' , message ) #NEWLINE# message = npc . build_add_ai ( 'doesnotexist' , message . bob ) #NEWLINE# self . assertEqual ( '"doesnotexist" is not a valid ai pack. See "help ai packs".' , message ) #NEWLINE# message = npc . build_add_ai ( 'merchant' , self . bob ) #NEWLINE# self . assertEqual ( 'This npc (Shiny McShinerson) is now a merchant.' , message ) #NEWLINE# message = npc . build_add_ai ( 'merchant' , self . bob ) #NEWLINE# self . assertEqual ( 'This npc (Shiny McShinerson) already has that ai pack.' , message ) #NEWLINE# message = str ( npc ) #NEWLINE# self . assertTrue ( ( 'MERCHANT ATTRIBUTES:' in message ) ) #NEWLINE# message = npc . build_remove_ai ( '' , self . bob ) #NEWLINE# self . assertEqual ( 'Try: "remove ai <ai-pack-name>", or type "help ai packs".' , message ) #NEWLINE# message = npc . build_remove_ai ( 'doesnotexist' , self . bob ) #NEWLINE# self . assertEqual ( 'This npc doesn\'t have the "doesnotexist" ai type.' , message ) #NEWLINE# message = npc . build_remove_ai ( 'merchant' , self . bob ) #NEWLINE# self . assertEqual ( 'Npc 1 (Shiny McShinerson) no longer has merchant ai.' , message ) #NEWLINE# message = npc . build_remove_ai ( 'merchant' , self . bob ) #NEWLINE# self . assertEqual ( 'This npc doesn\'t have the "merchant" ai type.' , message )