#NEWLINE# def test_windows_7( self ) : #NEWLINE# #INDENT# '\n            Test to make sure we can get the hibernate timeout value on windows 7\n        ' #NEWLINE# mock = MagicMock ( ) #NEWLINE# mock . side_effect = [ 'Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e  (Balanced)' , self . query_ouput ] #NEWLINE# with patch . dict ( powercfg . __salt__ , { #NEWLINE# #INDENT# 'cmd.run' : mock , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# with patch . dict ( powercfg . __grains__ , { #NEWLINE# #INDENT# 'osrelease' : '7' , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# ret = powercfg . get_hibernate_timeout ( ) #NEWLINE# calls = [ call ( 'powercfg /getactivescheme' , python_shell = False ) , call ( 'powercfg /q 381b4222-f694-41f0-9685-ff5bb260df2e SUB_SLEEP' , python_shell = False ) ] #NEWLINE# mock . assert_has_calls ( ret ) #NEWLINE# self . assertEqual ( { #NEWLINE# #INDENT# 'ac' : 30 , #NEWLINE# 'dc' : 15 , #NEWLINE# #UNINDENT# } , ret )