~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_config.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-03-06 06:48:25 UTC
  • mfrom: (4070.8.6 debug-config)
  • Revision ID: pqm@pqm.ubuntu.com-20090306064825-kbpwggw21dygeix6
(mbp) debug_flags configuration option

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
#
14
14
# You should have received a copy of the GNU General Public License
15
15
# along with this program; if not, write to the Free Software
16
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
17
 
18
18
"""Tests for finding and reading the bzr config file[s]."""
19
19
# import system imports here
150
150
        self._transport = self.control_files = \
151
151
            FakeControlFilesAndTransport(user_id=user_id)
152
152
 
153
 
    def _get_config(self):
154
 
        return config.TransportConfig(self._transport, 'branch.conf')
155
 
 
156
153
    def lock_write(self):
157
154
        pass
158
155
 
1430
1427
    def test_set_credentials(self):
1431
1428
        conf = config.AuthenticationConfig()
1432
1429
        conf.set_credentials('name', 'host', 'user', 'scheme', 'password',
1433
 
        99, path='/foo', verify_certificates=False, realm='realm')
 
1430
        99, path='/foo', verify_certificates=False)
1434
1431
        credentials = conf.get_credentials(host='host', scheme='scheme',
1435
 
                                           port=99, path='/foo',
1436
 
                                           realm='realm')
 
1432
                                           port=99, path='/foo')
1437
1433
        CREDENTIALS = {'name': 'name', 'user': 'user', 'password': 'password',
1438
 
                       'verify_certificates': False, 'scheme': 'scheme', 
1439
 
                       'host': 'host', 'port': 99, 'path': '/foo', 
1440
 
                       'realm': 'realm'}
 
1434
                       'verify_certificates': False,}
1441
1435
        self.assertEqual(CREDENTIALS, credentials)
1442
1436
        credentials_from_disk = config.AuthenticationConfig().get_credentials(
1443
 
            host='host', scheme='scheme', port=99, path='/foo', realm='realm')
 
1437
            host='host', scheme='scheme', port=99, path='/foo')
1444
1438
        self.assertEqual(CREDENTIALS, credentials_from_disk)
1445
1439
 
1446
1440
    def test_reset_credentials_different_name(self):
1450
1444
        self.assertIs(None, conf._get_config().get('name'))
1451
1445
        credentials = conf.get_credentials(host='host', scheme='scheme')
1452
1446
        CREDENTIALS = {'name': 'name2', 'user': 'user2', 'password':
1453
 
                       'password', 'verify_certificates': True, 
1454
 
                       'scheme': 'scheme', 'host': 'host', 'port': None, 
1455
 
                       'path': None, 'realm': None}
 
1447
                       'password', 'verify_certificates': True}
1456
1448
        self.assertEqual(CREDENTIALS, credentials)
1457
1449
 
1458
1450