~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_config.py

  • Committer: Patch Queue Manager
  • Date: 2012-07-28 15:55:41 UTC
  • mfrom: (5912.5.9 Base64CredentialStore)
  • Revision ID: pqm@pqm.ubuntu.com-20120728155541-d860rcyc2q82nhnj
(gz) Add Base64CredentialStore for authentication.conf password obfuscation
 (Martin Packman)

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
"""Tests for finding and reading the bzr config file[s]."""
18
 
# import system imports here
 
18
 
 
19
import base64
19
20
from cStringIO import StringIO
20
21
from textwrap import dedent
21
22
import os
22
23
import sys
23
24
import threading
24
25
 
25
 
 
26
26
from testtools import matchers
27
27
 
28
 
#import bzrlib specific imports here
29
28
from bzrlib import (
30
29
    branch,
31
30
    config,
4842
4841
        self.assertEquals('secret', decoded)
4843
4842
 
4844
4843
 
 
4844
class TestBase64CredentialStore(tests.TestCase):
 
4845
 
 
4846
    def test_decode_password(self):
 
4847
        r = config.credential_store_registry
 
4848
        plain_text = r.get_credential_store('base64')
 
4849
        decoded = plain_text.decode_password(dict(password='c2VjcmV0'))
 
4850
        self.assertEquals('secret', decoded)
 
4851
 
 
4852
 
4845
4853
# FIXME: Once we have a way to declare authentication to all test servers, we
4846
4854
# can implement generic tests.
4847
4855
# test_user_password_in_url