#NEWLINE# @ skipIf ( ( not HAS_WIN32NET_MODS ) , 'this test needs the w32net library' ) #NEWLINE# def test_get_computer_name( self ) : #NEWLINE# #INDENT# '\n            Test to get the Windows computer name\n        ' #NEWLINE# mock = MagicMock ( side_effect = [ 'Server Name Salt' , 'Salt' ] ) #NEWLINE# with patch . dict ( win_system . __salt__ , { #NEWLINE# #INDENT# 'cmd.run' : mock , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# self . assertEqual ( win_system . get_computer_name ( ) , 'Salt' ) #NEWLINE# self . assertFalse ( win_system . get_computer_name ( ) )