~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/sftp.py

  • Committer: John Arbash Meinel
  • Date: 2006-07-31 23:04:57 UTC
  • mto: This revision was merged to the branch mainline in revision 1902.
  • Revision ID: john@arbash-meinel.com-20060731230457-5e8f5a064959d474
Update tests to use a truly unused port

Show diffs side-by-side

added added

removed removed

Lines of Context:
1129
1129
 
1130
1130
    def get_bogus_url(self):
1131
1131
        """See bzrlib.transport.Server.get_bogus_url."""
1132
 
        # this is chosen to try to prevent trouble with proxies, wierd dns,
1133
 
        # etc
1134
 
        return 'sftp://127.0.0.1:1/'
1135
 
 
 
1132
        # this is chosen to try to prevent trouble with proxies, wierd dns, etc
 
1133
        # we bind a random socket, so that we get a guaranteed unused port
 
1134
        # we just never listen on that port
 
1135
        s = socket.socket()
 
1136
        s.bind(('localhost', 0))
 
1137
        return 'sftp://%s:%s/' % s.getsockname()
1136
1138
 
1137
1139
 
1138
1140
class SFTPFullAbsoluteServer(SFTPServer):