diff options
| author | Scott Moser <smoser@ubuntu.com> | 2015-02-10 20:53:20 -0500 |
|---|---|---|
| committer | Scott Moser <smoser@ubuntu.com> | 2015-02-10 20:53:20 -0500 |
| commit | cd632b2f153a61faa48531cb41d0288650e72c71 (patch) | |
| tree | a3a35b9ca437d999a15fdd25c0a0de88e3cafafb /tests/unittests/test_handler/test_handler_apt_configure.py | |
| parent | 78915c97c18d678db10e0fde0d9306823c5f4610 (diff) | |
| parent | f5f280cae778bd214b91664f28d9eed997fbcda5 (diff) | |
| download | vyos-cloud-init-cd632b2f153a61faa48531cb41d0288650e72c71.tar.gz vyos-cloud-init-cd632b2f153a61faa48531cb41d0288650e72c71.zip | |
python3 support.
This gives us functional python3 support. There are likely
still bugs, but instance boot on openstack is functional now.
LP: #1247132
Diffstat (limited to 'tests/unittests/test_handler/test_handler_apt_configure.py')
| -rw-r--r-- | tests/unittests/test_handler/test_handler_apt_configure.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/unittests/test_handler/test_handler_apt_configure.py b/tests/unittests/test_handler/test_handler_apt_configure.py index 203dd2aa..d8fe9a4f 100644 --- a/tests/unittests/test_handler/test_handler_apt_configure.py +++ b/tests/unittests/test_handler/test_handler_apt_configure.py @@ -1,27 +1,27 @@ -from mocker import MockerTestCase - from cloudinit import util from cloudinit.config import cc_apt_configure +from ..helpers import TestCase import os import re +import shutil +import tempfile +import unittest -class TestAptProxyConfig(MockerTestCase): +class TestAptProxyConfig(TestCase): def setUp(self): super(TestAptProxyConfig, self).setUp() - self.tmp = self.makeDir() + self.tmp = tempfile.mkdtemp() + self.addCleanup(shutil.rmtree, self.tmp) self.pfile = os.path.join(self.tmp, "proxy.cfg") self.cfile = os.path.join(self.tmp, "config.cfg") def _search_apt_config(self, contents, ptype, value): - print( - r"acquire::%s::proxy\s+[\"']%s[\"'];\n" % (ptype, value), - contents, "flags=re.IGNORECASE") - return(re.search( + return re.search( r"acquire::%s::proxy\s+[\"']%s[\"'];\n" % (ptype, value), - contents, flags=re.IGNORECASE)) + contents, flags=re.IGNORECASE) def test_apt_proxy_written(self): cfg = {'apt_proxy': 'myproxy'} @@ -60,7 +60,7 @@ class TestAptProxyConfig(MockerTestCase): contents = str(util.read_file_or_url(self.pfile)) - for ptype, pval in values.iteritems(): + for ptype, pval in values.items(): self.assertTrue(self._search_apt_config(contents, ptype, pval)) def test_proxy_deleted(self): |
