/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/plugins/netrc_credential_store/tests/test_netrc.py

  • Committer: Matt Nordhoff
  • Date: 2009-04-04 02:50:01 UTC
  • mfrom: (4253 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4256.
  • Revision ID: mnordhoff@mattnordhoff.com-20090404025001-z1403k0tatmc8l91
Merge bzr.dev, fixing conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
16
 
 
17
from cStringIO import StringIO
16
18
 
17
19
from bzrlib import (
18
20
    config,
69
71
        cs = self._get_netrc_cs()
70
72
        password = cs.decode_password(dict(host='other'))
71
73
        self.assertIs(None, password)
 
74
 
 
75
    def test_get_netrc_credentials_via_auth_config(self):
 
76
        # Create a test AuthenticationConfig object
 
77
        ac_content = """
 
78
[host1]
 
79
host = host
 
80
user = joe
 
81
password_encoding = netrc
 
82
"""
 
83
        conf = config.AuthenticationConfig(_file=StringIO(ac_content))
 
84
        credentials = conf.get_credentials('scheme', 'host', user='joe')
 
85
        self.assertIsNot(None, credentials)
 
86
        self.assertEquals('secret', credentials.get('password', None))