From 7dd4bf6310c61828dc2ac7777f5adf1004349715 Mon Sep 17 00:00:00 2001 From: Olof Johansson Date: Mon, 20 Jan 2014 12:03:24 +0100 Subject: bitbake: fetch2.URI: Set username/password should not change the other When setting the username after already having set the password, the password was unexpectedly reset. This change fixes this issue and introduces unit tests to make sure it doesn't happen again. (Bitbake rev: 25faef3a047f9c7564089463d7c96f6910b640cb) Signed-off-by: Olof Johansson Signed-off-by: Richard Purdie --- bitbake/lib/bb/tests/fetch.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'bitbake/lib/bb/tests/fetch.py') diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py index 4fb2178595..4be5a07bec 100644 --- a/bitbake/lib/bb/tests/fetch.py +++ b/bitbake/lib/bb/tests/fetch.py @@ -274,6 +274,20 @@ class URITest(unittest.TestCase): self.assertEqual(uri.username, test['username']) self.assertEqual(uri.password, test['password']) + # make sure changing the values doesn't do anything unexpected + uri.username = 'changeme' + self.assertEqual(uri.username, 'changeme') + self.assertEqual(uri.password, test['password']) + uri.password = 'insecure' + self.assertEqual(uri.username, 'changeme') + self.assertEqual(uri.password, 'insecure') + + # reset back after our trickery + uri.userinfo = test['userinfo'] + self.assertEqual(uri.userinfo, test['userinfo']) + self.assertEqual(uri.username, test['username']) + self.assertEqual(uri.password, test['password']) + uri.hostname = test['hostname'] self.assertEqual(uri.hostname, test['hostname']) self.assertEqual(uri.hostport, test['hostname']) -- cgit v1.2.3-54-g00ecf