summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMike Milner <mike.milner@canonical.com>2012-03-08 08:45:43 -0400
committerMike Milner <mike.milner@canonical.com>2012-03-08 08:45:43 -0400
commit0334e553a80f48362e5f8fd3fd5bb2f43b2ca3ea (patch)
tree0511283170ebb1fc78d07261fd6535a3b2e174fd /tests
parent9f719a8c427f639e1f0ea6725073be3081dd008e (diff)
downloadvyos-cloud-init-0334e553a80f48362e5f8fd3fd5bb2f43b2ca3ea.tar.gz
vyos-cloud-init-0334e553a80f48362e5f8fd3fd5bb2f43b2ca3ea.zip
Switch to using util.subp.
Diffstat (limited to 'tests')
-rw-r--r--tests/unittests/test_handler_ca_certs.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/unittests/test_handler_ca_certs.py b/tests/unittests/test_handler_ca_certs.py
index 37bd7a08..21d2442f 100644
--- a/tests/unittests/test_handler_ca_certs.py
+++ b/tests/unittests/test_handler_ca_certs.py
@@ -169,15 +169,14 @@ class TestRemoveDefaultCaCerts(MockerTestCase):
mock_delete_dir_contents = self.mocker.replace(delete_dir_contents,
passthrough=False)
mock_write = self.mocker.replace(write_file, passthrough=False)
- mock_check_call = self.mocker.replace("subprocess.check_call",
- passthrough=False)
+ mock_subp = self.mocker.replace("cloudinit.util.subp",
+ passthrough=False)
mock_delete_dir_contents("/usr/share/ca-certificates/")
mock_delete_dir_contents("/etc/ssl/certs/")
mock_write("/etc/ca-certificates.conf", "", mode=0644)
- mock_check_call([
- "echo 'ca-certificates ca-certificates/trust_new_crts select no'"
- " | debconf-set-selections"], shell=True)
+ mock_subp(('debconf-set-selections', '-'),
+ "ca-certificates ca-certificates/trust_new_crts select no")
self.mocker.replay()
remove_default_ca_certs()