def testCorrectVersion(self):
   mocked_flags = mock_flags.PatchTestCaseFlags(self)
   mocked_flags['azure_ignore_cli_version'].Parse(True)
   ret = azure.EXPECTED_CLI_VERSION, '', 0
   with mock.patch.object(util.vm_util, 'IssueCommand', return_value=ret):
     util._CheckAzureVersion()
 def testIncorrectVersion(self):
   ret = '0.9.3', '', 0
   with mock.patch.object(util.vm_util, 'IssueCommand', return_value=ret):
     with self.assertRaises(SystemExit):
       util._CheckAzureVersion()
 def testIgnoreCliVersionFlag(self):
   mocked_flags = mock_flags.PatchTestCaseFlags(self)
   mocked_flags['azure_ignore_cli_version'].Parse(True)
   ret = '0.9.3', '', 0
   with mock.patch.object(util.vm_util, 'IssueCommand', return_value=ret):
     util._CheckAzureVersion()
 def testAzureFailed(self):
   ret = '', '', 1
   with mock.patch.object(util.vm_util, 'IssueCommand', return_value=ret):
     with self.assertRaises(SystemExit):
       util._CheckAzureVersion()