~ubuntu-branches/ubuntu/karmic/bzr/karmic-proposed

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2009-04-11 14:25:12 UTC
  • mfrom: (1.1.51 upstream) (3.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20090411142512-jomeween5l8etlrm
Add missing dependency on zlib development library. (Closes:
#523595)

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))