#NEWLINE# def test_get_hostname( self ) : #NEWLINE# #INDENT# '\n            Test setting a new hostname\n        ' #NEWLINE# cmd_run_mock = MagicMock ( return_value = 'Name\nMINION' ) #NEWLINE# with patch . dict ( win_system . __salt__ , { #NEWLINE# #INDENT# 'cmd.run' : cmd_run_mock , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# ret = win_system . get_hostname ( ) #NEWLINE# self . assertEqual ( ret , 'MINION' ) #NEWLINE# #UNINDENT# cmd_run_mock . assert_called_once_with ( cmd = 'wmic computersystem get name' )