#NEWLINE# def test_installed( self ) : #NEWLINE# #INDENT# '\n            Test to see if the given license key is installed\n        ' #NEWLINE# mock = MagicMock ( return_value = 'Partial Product Key: ABCDE' ) #NEWLINE# with patch . dict ( license . __salt__ , { #NEWLINE# #INDENT# 'cmd.run' : mock , #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# out = license . installed ( 'AAAAA-AAAAA-AAAAA-AAAA-AAAAA-ABCDE' ) #NEWLINE# mock . assert_called_once_with ( 'cscript C:\\Windows\\System32\\slmgr.vbs /dli' ) #NEWLINE# self . assertTrue ( out )