summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/tests/fetch.py
diff options
context:
space:
mode:
authorOlof Johansson <olof.johansson@axis.com>2014-01-20 12:03:24 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-24 17:54:46 +0000
commit7dd4bf6310c61828dc2ac7777f5adf1004349715 (patch)
treefbc030576a80f9427d3c4488d0aa4e553c72818e /bitbake/lib/bb/tests/fetch.py
parent57484d68dff378e4f3bd0d3e40b9db02b029feb4 (diff)
downloadpoky-7dd4bf6310c61828dc2ac7777f5adf1004349715.tar.gz
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 <olof.johansson@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/tests/fetch.py')
-rw-r--r--bitbake/lib/bb/tests/fetch.py14
1 files changed, 14 insertions, 0 deletions
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):
274 self.assertEqual(uri.username, test['username']) 274 self.assertEqual(uri.username, test['username'])
275 self.assertEqual(uri.password, test['password']) 275 self.assertEqual(uri.password, test['password'])
276 276
277 # make sure changing the values doesn't do anything unexpected
278 uri.username = 'changeme'
279 self.assertEqual(uri.username, 'changeme')
280 self.assertEqual(uri.password, test['password'])
281 uri.password = 'insecure'
282 self.assertEqual(uri.username, 'changeme')
283 self.assertEqual(uri.password, 'insecure')
284
285 # reset back after our trickery
286 uri.userinfo = test['userinfo']
287 self.assertEqual(uri.userinfo, test['userinfo'])
288 self.assertEqual(uri.username, test['username'])
289 self.assertEqual(uri.password, test['password'])
290
277 uri.hostname = test['hostname'] 291 uri.hostname = test['hostname']
278 self.assertEqual(uri.hostname, test['hostname']) 292 self.assertEqual(uri.hostname, test['hostname'])
279 self.assertEqual(uri.hostport, test['hostname']) 293 self.assertEqual(uri.hostport, test['hostname'])