~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_sftp_transport.py

  • Committer: Patch Queue Manager
  • Date: 2016-02-01 19:13:13 UTC
  • mfrom: (6614.2.2 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20160201191313-wdfvmfff1djde6oq
(vila) Release 2.7.0 (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2011 Robey Pointer <robey@lag.net>
 
1
# Copyright (C) 2005-2012, 2016 Robey Pointer <robey@lag.net>
2
2
# Copyright (C) 2005, 2006, 2007 Canonical Ltd
3
3
#
4
4
# This program is free software; you can redistribute it and/or modify
155
155
    def test_parse_url_with_home_dir(self):
156
156
        s = _mod_sftp.SFTPTransport(
157
157
            'sftp://ro%62ey:h%40t@example.com:2222/~/relative')
158
 
        self.assertEquals(s._parsed_url.host, 'example.com')
159
 
        self.assertEquals(s._parsed_url.port, 2222)
160
 
        self.assertEquals(s._parsed_url.user, 'robey')
161
 
        self.assertEquals(s._parsed_url.password, 'h@t')
162
 
        self.assertEquals(s._parsed_url.path, '/~/relative/')
 
158
        self.assertEqual(s._parsed_url.host, 'example.com')
 
159
        self.assertEqual(s._parsed_url.port, 2222)
 
160
        self.assertEqual(s._parsed_url.user, 'robey')
 
161
        self.assertEqual(s._parsed_url.password, 'h@t')
 
162
        self.assertEqual(s._parsed_url.path, '/~/relative/')
163
163
 
164
164
    def test_relpath(self):
165
165
        s = _mod_sftp.SFTPTransport('sftp://user@host.com/abs/path')
200
200
        b2 = controldir.ControlDir.create_branch_and_repo(self.get_url('/b'))
201
201
        b2.pull(b)
202
202
 
203
 
        self.assertEquals(b2.last_revision(), 'a1')
 
203
        self.assertEqual(b2.last_revision(), 'a1')
204
204
 
205
205
        with open('a/foo', 'wt') as f: f.write('something new in foo\n')
206
206
        t.commit('new', rev_id='a2')
207
207
        b2.pull(b)
208
208
 
209
 
        self.assertEquals(b2.last_revision(), 'a2')
 
209
        self.assertEqual(b2.last_revision(), 'a2')
210
210
 
211
211
 
212
212
class SSHVendorConnection(TestCaseWithSFTPServer):
496
496
        t = self.get_transport_for_connection(set_config=False)
497
497
        self.assertIs(None, t._get_credentials()[0])
498
498
        # No prompts should've been printed, stdin shouldn't have been read
499
 
        self.assertEquals("", stdout.getvalue())
500
 
        self.assertEquals(0, ui.ui_factory.stdin.tell())
 
499
        self.assertEqual("", stdout.getvalue())
 
500
        self.assertEqual(0, ui.ui_factory.stdin.tell())