summaryrefslogtreecommitdiff
path: root/tests/unittests/test_handler/test_handler_zypper_add_repo.py
diff options
context:
space:
mode:
authorzdc <zdc@users.noreply.github.com>2020-09-15 21:35:20 +0300
committerGitHub <noreply@github.com>2020-09-15 21:35:20 +0300
commit76adf82b8a4dbcf636151d292175b7d1ac182fcf (patch)
treef57f3db085a724df237ffa64b589c6bb6dd3b28f /tests/unittests/test_handler/test_handler_zypper_add_repo.py
parent1a790ee102fd405e5c3a20a17a69ba0c118ed874 (diff)
parent7cd260b313267dc7123cb99a75d4555e24909cca (diff)
downloadvyos-cloud-init-76adf82b8a4dbcf636151d292175b7d1ac182fcf.tar.gz
vyos-cloud-init-76adf82b8a4dbcf636151d292175b7d1ac182fcf.zip
Merge pull request #18 from zdc/T2117-equuleus-20.3
T2117: Cloud-init updated to 20.3
Diffstat (limited to 'tests/unittests/test_handler/test_handler_zypper_add_repo.py')
-rw-r--r--tests/unittests/test_handler/test_handler_zypper_add_repo.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/unittests/test_handler/test_handler_zypper_add_repo.py b/tests/unittests/test_handler/test_handler_zypper_add_repo.py
index 9685ff28..0fb1de1a 100644
--- a/tests/unittests/test_handler/test_handler_zypper_add_repo.py
+++ b/tests/unittests/test_handler/test_handler_zypper_add_repo.py
@@ -1,17 +1,15 @@
# This file is part of cloud-init. See LICENSE file for license information.
+import configparser
import glob
+import logging
import os
-from io import StringIO
-from cloudinit.config import cc_zypper_add_repo
from cloudinit import util
-
+from cloudinit.config import cc_zypper_add_repo
from cloudinit.tests import helpers
from cloudinit.tests.helpers import mock
-import logging
-
LOG = logging.getLogger(__name__)
@@ -66,7 +64,8 @@ class TestConfig(helpers.FilesystemMockingTestCase):
root_d = self.tmp_dir()
cc_zypper_add_repo._write_repos(cfg['repos'], root_d)
contents = util.load_file("%s/testing-foo.repo" % root_d)
- parser = self.parse_and_read(StringIO(contents))
+ parser = configparser.ConfigParser()
+ parser.read_string(contents)
expected = {
'testing-foo': {
'name': 'test-foo',