
This module is quite useful for fetching urls in a manner that can be provided custom headers, retries and ssl_args so let's ensure we have it available for usage under these circumstances. Also adds some basic sanity tests so that it will continue to work as expected. Change-Id: I4d5e777cf530e822bbea69c76846ebebb48a7927
22 lines
598 B
Python
22 lines
598 B
Python
# Copyright 2015 Canonical Ltd.
|
|
# This file is part of cloud-init. See LICENCE file for license information.
|
|
#
|
|
# vi: ts=4 expandtab
|
|
|
|
import httpretty
|
|
import testtools
|
|
|
|
|
|
class TestCase(testtools.TestCase):
|
|
"""Base class for all cloud-init test cases."""
|
|
|
|
def setUp(self):
|
|
super(TestCase, self).setUp()
|
|
# Do not allow any unknown network connections to get triggered...
|
|
httpretty.HTTPretty.allow_net_connect = False
|
|
|
|
def tearDown(self):
|
|
super(TestCase, self).tearDown()
|
|
# Ok allow it again....
|
|
httpretty.HTTPretty.allow_net_connect = True
|