~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_http_implementations.py

  • Committer: Vincent Ladeuil
  • Date: 2007-12-20 19:51:47 UTC
  • mto: (3146.3.1 179368) (3156.2.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 3158.
  • Revision ID: v.ladeuil+lp@free.fr-20071220195147-2lcf8kynegha2kvr
Complete fix #177643 by reporting tests modifications.

Show diffs side-by-side

added added

removed removed

Lines of Context:
937
937
            server = http_utils.HTTPDigestAuthServer()
938
938
        return server
939
939
 
 
940
    def _testing_pycurl(self):
 
941
        return pycurl_present and self._transport == PyCurlTransport
 
942
 
940
943
    def get_user_url(self, user=None, password=None):
941
944
        """Build an url embedding user and password"""
942
945
        url = '%s://' % self.server._url_protocol
959
962
        self.assertEqual(1, self.server.auth_required_errors)
960
963
 
961
964
    def test_empty_pass(self):
 
965
        if self._testing_pycurl() and self._proxy:
 
966
            raise tests.KnownFailure(
 
967
                'some versions of pycurl does not handle empty proxy passwords')
 
968
 
962
969
        self.server.add_user('joe', '')
963
970
        t = self.get_user_transport('joe', '')
964
971
        self.assertEqual('contents of a\n', t.get('a').read())
990
997
        self.assertEqual(2, self.server.auth_required_errors)
991
998
 
992
999
    def test_prompt_for_password(self):
 
1000
        if self._testing_pycurl():
 
1001
            raise tests.TestNotApplicable(
 
1002
                'pycurl cannot prompt, it handles auth by embedding'
 
1003
                ' user:pass in urls only')
 
1004
 
993
1005
        self.server.add_user('joe', 'foo')
994
1006
        t = self.get_user_transport('joe', None)
995
1007
        stdout = tests.StringIOWrapper()
1017
1029
        self.assertEquals(expected_prompt, actual_prompt)
1018
1030
 
1019
1031
    def test_no_prompt_for_password_when_using_auth_config(self):
 
1032
        if self._testing_pycurl():
 
1033
            raise tests.TestNotApplicable(
 
1034
                'pycurl does not support authentication.conf'
 
1035
                ' since it cannot prompt')
 
1036
 
1020
1037
        user =' joe'
1021
1038
        password = 'foo'
1022
1039
        stdin_content = 'bar\n'  # Not the right password
1078
1095
        for name, value in self._old_env.iteritems():
1079
1096
            osutils.set_or_unset_env(name, value)
1080
1097
 
 
1098
    def test_empty_pass(self):
 
1099
        if self._testing_pycurl():
 
1100
            import pycurl
 
1101
            if pycurl.version_info()[1] < '7.16.0':
 
1102
                raise tests.KnownFailure(
 
1103
                    'pycurl < 7.16.0 does not handle empty proxy passwords')
1081
1104