old_contents: import unittest
  
  
  class CLITest(unittest.TestCase):
  
      def test_it(self):
          from letsencrypt.client import cli
          self.assertRaises(SystemExit, cli.main, ['--help'])
  
  
  if __name__ == '__main__':
      unittest.main()
  
new_contents: """Tests for letsencrypt.client.cli."""
  import itertools
  import sys
  import unittest
  
  import mock
  import zope.component
  
  from letsencrypt.client.display import util as display_util
  
  
  class CLITest(unittest.TestCase):
      """Tests for different commands."""
  
      def _call(self, args):
          from letsencrypt.client import cli
          args = ['--text'] + args
          with mock.patch("letsencrypt.client.cli.sys.stdout") as stdout:
              with mock.patch("letsencrypt.client.cli.sys.stderr") as stderr:
                  ret = cli.main(args)
          return ret, stdout, stderr
  
      def test_no_flags(self):
          self.assertRaises(SystemExit, self._call, [])
  
      def test_help(self):
          self.assertRaises(SystemExit, self._call, ['--help'])
  
      def test_plugins(self):
          flags = ['--init', '--prepare', '--authenticators', '--installers']
          for args in itertools.chain(*(itertools.combinations(flags, r)
                       for r in xrange(len(flags)))):
              print args
              self._call(['plugins',] + list(args))
  
  
  if __name__ == '__main__':
      unittest.main()
  
subject: Test CLI plugins command