diff options
author | Scott Moser <smoser@ubuntu.com> | 2013-03-20 08:35:24 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2013-03-20 08:35:24 -0400 |
commit | 41190448decad51cf76a85d727e6935a8a206cca (patch) | |
tree | f4548e8595cafff2ffc13d914dbadef7b8c737db /tests/unittests/test__init__.py | |
parent | f8318f8eec9c8f1c1676ce6a5b5c2c77fa2f7cc5 (diff) | |
parent | ab71760d7e127ae9a3cf31a4f6d7600c945f0dd7 (diff) | |
download | vyos-cloud-init-41190448decad51cf76a85d727e6935a8a206cca.tar.gz vyos-cloud-init-41190448decad51cf76a85d727e6935a8a206cca.zip |
use 'requests' rather than urllib2.
This re-works the urlhelper and users of it to use requests rather
than urllib2. The primary benefit is that now when using recent
versions of python-requests (>= 0.8.8) https certificates will be checked.
Diffstat (limited to 'tests/unittests/test__init__.py')
-rw-r--r-- | tests/unittests/test__init__.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/unittests/test__init__.py b/tests/unittests/test__init__.py index 2c0abfbc..b4b20e51 100644 --- a/tests/unittests/test__init__.py +++ b/tests/unittests/test__init__.py @@ -195,8 +195,8 @@ class TestCmdlineUrl(MockerTestCase): mock_readurl = self.mocker.replace(url_helper.readurl, passthrough=False) - mock_readurl(url) - self.mocker.result(url_helper.UrlResponse(200, payload)) + mock_readurl(url, ARGS, KWARGS) + self.mocker.result(util.StringResponse(payload)) self.mocker.replay() self.assertEqual((key, url, None), @@ -211,8 +211,8 @@ class TestCmdlineUrl(MockerTestCase): mock_readurl = self.mocker.replace(url_helper.readurl, passthrough=False) - mock_readurl(url) - self.mocker.result(url_helper.UrlResponse(200, payload)) + mock_readurl(url, ARGS, KWARGS) + self.mocker.result(util.StringResponse(payload)) self.mocker.replay() self.assertEqual((key, url, payload), @@ -225,7 +225,7 @@ class TestCmdlineUrl(MockerTestCase): cmdline = "ro %s=%s bar=1" % (key, url) self.mocker.replace(url_helper.readurl, passthrough=False) - self.mocker.result(url_helper.UrlResponse(400)) + self.mocker.result(util.StringResponse("")) self.mocker.replay() self.assertEqual((None, None, None), |