ó
Y[c           @   sr  d  Z  d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l m	 Z	 d d l
 m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l j j Z d d	 l m Z e j j ƒ  Z d
 e f d „  ƒ  YZ d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d „  Z e  d k rne j! ƒ  n  d S(   s   Tests for certbot.cli.iÿÿÿÿN(   t   reload_module(   t
   challenges(   t   cli(   t	   constants(   t   errors(   t   disco(   t   TempDirTestCaset   TestReadFilec           B   s   e  Z d  Z d „  Z RS(   s   Test cli.read_filec         C   s­   t  j j t  j j |  j d ƒ ƒ } |  j t j t j	 | ƒ d } t
 | d ƒ  } | j | ƒ Wd  QXt j	 | ƒ \ } } |  j | t  j j | ƒ ƒ |  j | | ƒ d  S(   Nt   foos   bar
t   wb(   t   ost   patht   relpatht   joint   tempdirt   assertRaisest   argparset   ArgumentTypeErrorR   t	   read_filet   opent   writet   assertEqualt   abspath(   t   selft   rel_test_patht   test_contentst   fR   t   contents(    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   test_read_file   s    $(   t   __name__t
   __module__t   __doc__R   (    (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyR      s   t	   ParseTestc           B   sm  e  Z d  Z d „  Z e d „  ƒ Z e d „  ƒ Z d „  Z e j	 d ƒ d „  ƒ Z
 d „  Z d „  Z d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z  d „  Z! d „  Z" d „  Z# d  „  Z$ d! „  Z% d" „  Z& d# „  Z' d$ „  Z( d% „  Z) RS(&   s   Test the cli args entrypointc         C   s   t  t ƒ d  S(   N(   R    R   (   R   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   setUp1   s    c          O   s   t  j t |  | Ž S(   s)   Get result of cli.prepare_and_parse_args.(   R   t   prepare_and_parse_argst   PLUGINS(   t   argst   kwargs(    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   _unmocked_parse4   s    c          O   s'   t  j ƒ   t j |  | Ž  SWd QXd S(   s:   Mocks zope.component.getUtility and calls _unmocked_parse.N(   t	   test_utilt   patch_get_utilityR    R&   (   R$   R%   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   parse9   s    c            s”   t  j ƒ  ‰  ‡  f d †  } t j d d ˆ  ƒX t j ƒ  E } | | ƒ  j _ t j d ƒ  |  j t	 |  j
 | ˆ  ƒ Wd QXWd QXWd QXˆ  j ƒ  S(   s8   Run a command, and return the output string for scrutinyc            s   ˆ  j  |  ƒ d  S(   N(   R   (   t   messageR$   R%   (   t   output(    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt	   write_msgD   s    s   certbot.main.sys.stdoutt   news   certbot.main.sys.stderrN(   t   sixt   StringIOt   mockt   patchR'   R(   t   notificationt   side_effectR   t
   SystemExitR&   t   getvalue(   R   R$   R,   t   mock_get_utility(    (   R+   s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   _help_output?   s    +s   certbot.cli.flag_defaultc            s±   t  j ƒ  ‰  ‡  f d †  } | | _ |  j d g ƒ } |  j | j g  ƒ ˆ  j d ƒ ˆ  j ƒ  |  j d g ƒ } |  j | j d g ƒ |  j d g ƒ } |  j | j g  ƒ d  S(   Nc            s*   |  d k r  t  j t j |  ƒ Sˆ  j g S(   Nt   config_files(   t   copyt   deepcopyR   t   CLI_DEFAULTSt   name(   t   v(   t
   tmp_config(    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   <lambda>T   s     t   certonlys   domains = example.coms   example.comt   renew(   t   tempfilet   NamedTemporaryFileR3   R)   R   t   domainsR   t   flush(   R   t   mock_flag_defaultt   shimt	   namespace(    (   R>   s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   test_cli_ini_domainsO   s    	
c         C   sF   |  j  g  ƒ } x0 d D]( } |  j t | | ƒ t j | ƒ ƒ q Wd  S(   Nt
   config_dirt   logs_dirt   work_dir(   s
   config_dirRK   RL   (   R)   R   t   getattrR   t   flag_default(   R   RH   t   d(    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   test_no_argsc   s    c         C   sØ   d } d } d } d } t  j d ƒ / |  j d d | d d d	 d d
 d g	 ƒ } Wd  QX|  j | j t j j | ƒ ƒ |  j | j t j j | ƒ ƒ |  j | j	 t j j | ƒ ƒ |  j | j
 t j j | ƒ ƒ d  S(   Nt   certt   keyt   chaint	   fullchains   certbot.main.installt   installs   --cert-paths
   --key-paths   --chain-paths   --fullchain-path(   R0   R1   R)   R   t	   cert_pathR
   R   R   t   key_patht
   chain_patht   fullchain_path(   R   RQ   RR   RS   RT   RH   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   test_install_abspathh   s    	c         C   s  |  j  d g ƒ |  j  d d g ƒ } |  j d | k ƒ |  j d | k ƒ |  j d | k ƒ |  j d | k ƒ |  j d | k ƒ |  j d | k ƒ |  j d	 | k ƒ |  j d
 | k ƒ |  j  d d g ƒ } d t k rô |  j d | k ƒ n  |  j d | k ƒ |  j d | k ƒ |  j  d g ƒ } |  j d | k ƒ d t k ra|  j d | k ƒ n |  j d | k ƒ |  j  d d g ƒ } |  j d | k ƒ |  j d | k ƒ |  j d | k ƒ |  j  d d g ƒ } |  j d | k ƒ |  j  d d g ƒ } |  j d | k ƒ |  j  d d g ƒ } |  j d | k ƒ |  j  d d g ƒ } |  j d | k ƒ |  j d | k ƒ |  j  d d g ƒ } |  j d | k ƒ |  j d | k ƒ |  j d | k ƒ |  j d | k ƒ |  j d | k ƒ |  j  d d g ƒ } |  j d | k ƒ |  j d | k ƒ |  j  d g ƒ } |  j t j | k ƒ |  j t j d   | k ƒ |  j d | k ƒ |  j d	 | k ƒ d  S(!   Ns   --helpt   alls   --configurators   how a certificate is deployeds   --webroot-paths   --texts   --dialogs   %ss   {0}s   --renew-hooks   -ht   nginxs   --nginx-ctls   --checkpointss   letsencrypt-autos   Use the Nginx plugins    (the certbot nginx plugin is nott   pluginss	   --prepares   "plugins" subcommandRA   s   --keept
   automationt   revokeRU   s   --cert-paths
   --key-paths   --reasons   --delete-after-revokes   --no-delete-after-revoket   config_changesid   (   R7   t
   assertTrueR#   R   t   SHORT_USAGEt   COMMAND_OVERVIEW(   R   t   out(    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt	   test_helpx   s^    c         C   s$  |  j  d g ƒ |  j  d d g ƒ } |  j d | k ƒ |  j d | k ƒ |  j d | k ƒ |  j d | k ƒ |  j d | k ƒ |  j d | k ƒ |  j d	 | k ƒ |  j  d d
 g ƒ } |  j d | k ƒ |  j d | k ƒ |  j  d d g ƒ } |  j d | k ƒ |  j d | k ƒ d  S(   Nt   helpR[   s   --configurators   how a certificate is deployeds   --webroot-paths   --texts   --dialogs   %ss   {0}RU   s   --cert-paths
   --key-pathR_   (   R7   Ra   (   R   Rd   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   test_help_no_dashes´   s    c         C   s3  d d g } |  j  | ƒ } |  j | j d g ƒ d d g } |  j  | ƒ } |  j | j d g ƒ d d g } |  j  | ƒ } |  j | j d d d g ƒ d d g } |  j  | ƒ } |  j | j d g ƒ d d g } |  j  | ƒ } |  j | j d g ƒ d d	 g } |  j  | ƒ } |  j | j d d g ƒ d  S(
   Ns   -ds   example.coms   trailing.period.com.s   trailing.period.coms-   example.com,another.net,third.org,example.coms   another.nets	   third.orgs	   --domainss#   example.com,another.net,example.com(   R)   R   RD   (   R   t
   short_argsRH   t	   long_args(    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   test_parse_domainsÈ   s&    
c         C   s‹   d d g } |  j  | ƒ } t j j t j j t j j g } |  j | j | ƒ d d g } t j	 d ƒ  |  j
 t |  j  | ƒ Wd  QXd  S(   Ns   --preferred-challengess   http, tls-sni-01, dnss   jumping-over-the-moons
   sys.stderr(   R)   R   t   HTTP01t   typt   TLSSNI01t   DNS01R   t   pref_challsR0   R1   R   R4   (   R   Rh   RH   t   expected(    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   test_preferred_challengesâ   s    	c         C   s,   |  j  d j ƒ  ƒ } |  j | j d ƒ d  S(   Ns   --server example.coms   example.com(   R)   t   splitR   t   server(   R   RH   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   test_server_flagð   s    c         C   s<   d g } |  j  | ƒ } |  j | j ƒ |  j | j ƒ d  S(   Ns   --must-staple(   R)   Ra   t   must_staplet   staple(   R   Rh   RH   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   test_must_staple_flagô   s    	c         C   sp   d d g } t  j ƒ  } t j d d | ƒ |  j | ƒ } Wd  QX|  j | j ƒ |  j d | j ƒ  k ƒ d  S(   NRA   s   --dialogs   certbot.main.sys.stderrR-   s   --dialog is deprecated(   R.   R/   R0   R1   R)   Ra   t   noninteractive_modeR5   (   R   R$   t   stderrRH   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   test_no_guiú   s    c         C   s   y0 |  j  | ƒ |  j d j d j | ƒ ƒ ƒ WnY t j k
 r‹ } |  j d t | ƒ k ƒ x+ | D] } |  j | t | ƒ k ƒ qe Wn Xd  S(   Ns6   The following flags didn't conflict with --server: {0}s   , s   --server(   R)   t   failt   formatR   R   t   ErrorRa   t   str(   R   t   parser_argst   conflicting_argst   errort   arg(    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   _check_server_conflict_message  s    c         C   sb   d g } |  j  | ƒ } |  j | j ƒ |  j | j t j ƒ | d j ƒ  7} |  j | d ƒ d  S(   Ns	   --stagings   --server example.com(	   R)   Ra   t   stagingR   Rs   R   t   STAGING_URIRr   Rƒ   (   R   Rh   RH   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   test_staging_flag  s    	c         C   s“   |  j  | j ƒ |  j  | j ƒ |  j  | j ƒ |  j | j t j ƒ | ro |  j  | j ƒ |  j  | j	 ƒ n  |  j
 | j ƒ |  j
 | j	 ƒ d  S(   N(   Ra   t   dry_runt   break_my_certsR„   R   Rs   R   R…   t   tost   register_unsafely_without_emailt   assertFalse(   R   RH   t   existing_account(    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   _assert_dry_run_flag_worked  s    c         C   s˜  t  j ƒ  } d j | ƒ j ƒ  } |  j t j |  j | ƒ |  j |  j | d g ƒ t	 ƒ |  j |  j | d g ƒ t	 ƒ |  j |  j | d g ƒ t	 ƒ t
 j j | t j ƒ } t
 j | ƒ t
 j t
 j j | d ƒ ƒ |  j |  j | d g ƒ t ƒ |  j |  j | d g ƒ t ƒ | d g 7} |  j |  j | ƒ t ƒ | d j ƒ  7} d g } |  j | d ƒ | d g 7} | d g 7} |  j | | ƒ d  S(	   Ns   --dry-run --config-dir {0}t   authR@   RA   t   fake_account_dirs   --server example.coms	   --dry-runs	   --staging(   RB   t   mkdtempR|   Rr   R   R   R}   R)   R   t   FalseR
   R   R   R   t   ACCOUNTS_DIRt   mkdirt   TrueRƒ   (   R   RJ   Rh   t   account_dirt	   conflicts(    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   test_dry_run_flag$  s,      	c         C   s   d } t  j | ƒ } |  j d j | ƒ j ƒ  ƒ |  j t  j | | ƒ ƒ |  j t  j d t ƒ ƒ d } |  j t  j | t  j | ƒ ƒ ƒ d  S(   Nt   rsa_key_sizes   --rsa-key-size {0}t   no_verify_sslRJ   (	   R   RN   R)   R|   Rr   Ra   t   option_was_setR”   R‹   (   R   t   key_size_optiont   key_size_valuet   config_dir_option(    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   test_option_was_setA  s    c         C   sš   xE t  j j ƒ  D]4 \ } } |  j d | g ƒ } |  j | j | ƒ q WxK t  j j ƒ  D]: \ } } |  j d | j ƒ  g ƒ } |  j | j | ƒ qX Wd  S(   Ns   --reason(   R   t   REVOCATION_REASONSt   itemsR)   R   t   reasont   upper(   R   R¡   t   codeRH   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   test_encode_revocation_reasonM  s    c         C   sB   |  j  t j |  j d j ƒ  ƒ |  j  t j |  j d j ƒ  ƒ d  S(   Ns   renew --force-interactives   -n --force-interactive(   R   R   R}   R)   Rr   (   R   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   test_force_interactiveU  s    c         C   s6   t  j d ƒ ! |  j t |  j d j ƒ  ƒ Wd  QXd  S(   Ns   certbot.cli.sys.stderrs"   --renew-hook foo --deploy-hook bar(   R0   R1   R   R4   R)   Rr   (   R   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   test_deploy_hook_conflict[  s    c         C   sN   d } |  j  d | d | d g ƒ } |  j | j | ƒ |  j | j | ƒ d  S(   NR   s   --renew-hooks   --deploy-hooks   --disable-hook-validation(   R)   R   t   deploy_hookt
   renew_hook(   R   t   valueRH   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt#   test_deploy_hook_matches_renew_hook`  s    c         C   sH   d } |  j  d | d g ƒ } |  j | j | ƒ |  j | j | ƒ d  S(   NR   s   --deploy-hooks   --disable-hook-validation(   R)   R   R§   R¨   (   R   R©   RH   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt    test_deploy_hook_sets_renew_hookh  s
    c         C   s6   t  j d ƒ ! |  j t |  j d j ƒ  ƒ Wd  QXd  S(   Ns   certbot.cli.sys.stderrs"   --deploy-hook foo --renew-hook bar(   R0   R1   R   R4   R)   Rr   (   R   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   test_renew_hook_conflicto  s    c         C   sN   d } |  j  d | d | d g ƒ } |  j | j | ƒ |  j | j | ƒ d  S(   NR   s   --deploy-hooks   --renew-hooks   --disable-hook-validation(   R)   R   R§   R¨   (   R   R©   RH   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt#   test_renew_hook_matches_deploy_hookt  s    c         C   sH   d } |  j  d | d g ƒ } |  j | j d  ƒ |  j | j | ƒ d  S(   NR   s   --renew-hooks   --disable-hook-validation(   R)   R   R§   t   NoneR¨   (   R   R©   RH   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt'   test_renew_hook_does_not_set_renew_hook|  s
    c         C   sR   t  j d ƒ = |  j t |  j d j ƒ  ƒ |  j t |  j d j ƒ  ƒ Wd  QXd  S(   Ns   certbot.cli.sys.stderrs   --max-log-backups foos   --max-log-backups -42(   R0   R1   R   R4   R)   Rr   (   R   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   test_max_log_backups_errorƒ  s
    c         C   s8   d } |  j  d | g ƒ } |  j | j t | ƒ ƒ d  S(   Nt   42s   --max-log-backups(   R)   R   t   max_log_backupst   int(   R   R©   RH   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   test_max_log_backups_successŠ  s    c         C   sŒ   |  j  g  ƒ } |  j | j g  ƒ |  j | j g  ƒ t j j g | _ d g | _ |  j  g  ƒ } |  j | j g  ƒ |  j | j g  ƒ d  S(   Ns   example.com(   R)   R   RD   Ro   R   Rk   Rl   (   R   RH   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   test_unchanging_defaults  s    c         C   s    |  j  |  j d g ƒ j ƒ d  S(   Ns   --no-directory-hooks(   R‹   R)   t   directory_hooks(   R   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   test_no_directory_hooks_set›  s    c         C   s   |  j  |  j g  ƒ j ƒ d  S(   N(   Ra   R)   R¶   (   R   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   test_no_directory_hooks_unsetž  s    c         C   s&   |  j  d g ƒ } |  j | j ƒ d  S(   Ns   --delete-after-revoke(   R)   Ra   t   delete_after_revoke(   R   RH   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   test_delete_after_revoke¡  s    c         C   s&   |  j  g  ƒ } |  j | j d  ƒ d  S(   N(   R)   R   R¹   R®   (   R   RH   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt    test_delete_after_revoke_default¥  s    c         C   s&   |  j  d g ƒ } |  j | j ƒ d  S(   Ns   --no-delete-after-revoke(   R)   R‹   R¹   (   R   RH   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   test_no_delete_after_revoke©  s    c         C   s#   |  j  t j |  j d j ƒ  ƒ d  S(   Ns(   --allow-subset-of-names -d *.example.org(   R   R   R}   R)   Rr   (   R   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   test_allow_subset_with_wildcard­  s    (*   R   R   R   R!   t   staticmethodR&   R)   R7   R0   R1   RI   RP   RZ   Re   Rg   Rj   Rq   Rt   Rw   Rz   Rƒ   R†   R   R—   Rž   R¤   R¥   R¦   Rª   R«   R¬   R­   R¯   R°   R´   Rµ   R·   R¸   Rº   R»   R¼   R½   (    (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyR    -   sJ   					<																													t   DefaultTestc           B   s2   e  Z d  Z d „  Z d „  Z d „  Z d „  Z RS(   s   Tests for certbot.cli._Default.c         C   s"   t  j ƒ  |  _ t  j ƒ  |  _ d  S(   N(   R   t   _Defaultt   default1t   default2(   R   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyR!   ¶  s    c         C   s$   |  j  |  j ƒ |  j  |  j ƒ d  S(   N(   R‹   RÁ   RÂ   (   R   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   test_boolean»  s    c         C   s   |  j  |  j |  j ƒ d  S(   N(   R   RÁ   RÂ   (   R   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   test_equality¿  s    c         C   s&   |  j  t |  j ƒ t |  j ƒ ƒ d  S(   N(   R   t   hashRÁ   RÂ   (   R   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt	   test_hashÂ  s    (   R   R   R   R!   RÃ   RÄ   RÆ   (    (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyR¿   ²  s
   			t   SetByCliTestc           B   sD   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s3   Tests for certbot.set_by_cli and related functions.c         C   s   t  t ƒ d  S(   N(   R    R   (   R   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyR!   Ê  s    c         C   s#   |  j  t d d j ƒ  d ƒ ƒ d  S(   NR¨   s   --deploy-hook fooRA   (   Ra   t   _call_set_by_cliRr   (   R   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   test_deploy_hookÍ  s    	c         C   s/   d j  ƒ  } d } |  j t d | | ƒ ƒ d  S(   Ns   -w /var/www/html -d example.comRA   t   webroot_map(   Rr   Ra   RÈ   (   R   R$   t   verb(    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   test_webroot_mapÑ  s    c         C   s.   t  j d d ƒ t  j d d ƒ |  j ƒ  d  S(   Nt   manual_public_ip_logging_okt   manual_auth_hookt   manual(   R   t   report_config_interactiont&   _test_report_config_interaction_common(   R   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt"   test_report_config_interaction_strÖ  s    	c         C   s.   t  j d d ƒ t  j d d ƒ |  j ƒ  d  S(   NRÍ   RÎ   RÏ   (   s   manual_public_ip_logging_ok(   s   manual_auth_hook(   s   manual_auth_hook(   s   manual(   R   RÐ   RÑ   (   R   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt'   test_report_config_interaction_iterableÝ  s    	c         C   s˜   d g } d } x' d	 D] } |  j  t | | | ƒ ƒ q Wd t j _ d d g } x' d
 D] } |  j  t | | | ƒ ƒ qX W|  j t d | | ƒ ƒ d S(   s  Tests implied interaction between manual flags.

        --manual implies --manual-auth-hook which implies
        --manual-public-ip-logging-ok. These interactions don't actually
        exist in the client, but are used here for testing purposes.

        s   --manualRA   RÏ   RÎ   RÍ   s   --manual-auth-hookt   commandN(   s   manuals   manual_auth_hooks   manual_public_ip_logging_ok(   s   manual_auth_hooks   manual_public_ip_logging_ok(   Ra   RÈ   R®   R   t
   set_by_clit   detectorR‹   (   R   R$   RË   R=   (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyRÑ   ä  s    		(	   R   R   R   R!   RÉ   RÌ   RÒ   RÓ   RÑ   (    (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyRÇ   Æ  s   					c      
   C   sN   t  j d ƒ 9 } t j ƒ  $ | | _ | | _ t j |  ƒ SWd  QXWd  QXd  S(   Ns   certbot.cli.helpful_parser(   R0   R1   R'   R(   R$   RË   R   RÕ   (   t   varR$   RË   t   mock_parser(    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyRÈ   ü  s
    		t   __main__("   R   R   t   unittestR
   RB   R9   R0   R.   t	   six.movesR    t   acmeR   t   certbotR   R   R   t   certbot.pluginsR   t   certbot.tests.utilt   testst   utilR'   R   t   PluginsRegistryt   find_allR#   R   t   TestCaseR    R¿   RÇ   RÈ   R   t   main(    (    (    s:   /usr/lib/python2.7/dist-packages/certbot/tests/cli_test.pyt   <module>   s0   ÿ †6	