2736
2736
def test_username_defaults_prompts(self):
2737
2737
# HTTP prompts can't be tested here, see test_http.py
2738
self._check_default_username_prompt('FTP %(host)s username: ', 'ftp')
2739
self._check_default_username_prompt(
2740
'FTP %(host)s:%(port)d username: ', 'ftp', port=10020)
2741
self._check_default_username_prompt(
2742
'SSH %(host)s:%(port)d username: ', 'ssh', port=12345)
2738
self._check_default_username_prompt(u'FTP %(host)s username: ', 'ftp')
2739
self._check_default_username_prompt(
2740
u'FTP %(host)s:%(port)d username: ', 'ftp', port=10020)
2741
self._check_default_username_prompt(
2742
u'SSH %(host)s:%(port)d username: ', 'ssh', port=12345)
2744
2744
def test_username_default_no_prompt(self):
2745
2745
conf = config.AuthenticationConfig()
2751
2751
def test_password_default_prompts(self):
2752
2752
# HTTP prompts can't be tested here, see test_http.py
2753
2753
self._check_default_password_prompt(
2754
'FTP %(user)s@%(host)s password: ', 'ftp')
2755
self._check_default_password_prompt(
2756
'FTP %(user)s@%(host)s:%(port)d password: ', 'ftp', port=10020)
2757
self._check_default_password_prompt(
2758
'SSH %(user)s@%(host)s:%(port)d password: ', 'ssh', port=12345)
2754
u'FTP %(user)s@%(host)s password: ', 'ftp')
2755
self._check_default_password_prompt(
2756
u'FTP %(user)s@%(host)s:%(port)d password: ', 'ftp', port=10020)
2757
self._check_default_password_prompt(
2758
u'SSH %(user)s@%(host)s:%(port)d password: ', 'ssh', port=12345)
2759
2759
# SMTP port handling is a bit special (it's handled if embedded in the
2761
2761
# FIXME: should we: forbid that, extend it to other schemes, leave
2762
2762
# things as they are that's fine thank you ?
2763
self._check_default_password_prompt('SMTP %(user)s@%(host)s password: ',
2765
self._check_default_password_prompt('SMTP %(user)s@%(host)s password: ',
2766
'smtp', host='bar.org:10025')
2767
self._check_default_password_prompt(
2768
'SMTP %(user)s@%(host)s:%(port)d password: ',
2763
self._check_default_password_prompt(
2764
u'SMTP %(user)s@%(host)s password: ', 'smtp')
2765
self._check_default_password_prompt(
2766
u'SMTP %(user)s@%(host)s password: ', 'smtp', host='bar.org:10025')
2767
self._check_default_password_prompt(
2768
u'SMTP %(user)s@%(host)s:%(port)d password: ', 'smtp', port=10025)
2771
2770
def test_ssh_password_emits_warning(self):
2772
2771
conf = config.AuthenticationConfig(_file=StringIO(