diff options
author | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2016-05-10 21:03:07 +0200 |
---|---|---|
committer | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2016-05-10 21:03:07 +0200 |
commit | 86c59ffa50a74a1d0001c5ef6ccc78bd6f656fdc (patch) | |
tree | c8c3e2ea59b0775e5847a33cd33680cf810fa763 /tests | |
parent | 904aeedf343af17ef88bbbaef9896d425eefa778 (diff) | |
download | vyos-cloud-init-86c59ffa50a74a1d0001c5ef6ccc78bd6f656fdc.tar.gz vyos-cloud-init-86c59ffa50a74a1d0001c5ef6ccc78bd6f656fdc.zip |
use proper asserRaises for try catch
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unittests/test_handler/test_handler_apt_source.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/unittests/test_handler/test_handler_apt_source.py b/tests/unittests/test_handler/test_handler_apt_source.py index 10a03a8d..a4d359a5 100644 --- a/tests/unittests/test_handler/test_handler_apt_source.py +++ b/tests/unittests/test_handler/test_handler_apt_source.py @@ -132,8 +132,7 @@ class TestAptSourceConfig(TestCase): try: util.subp(('apt-key', 'list', '03683F77')) except util.ProcessExecutionError as err: - print("apt-key failed. " + str(err)) - self.assertTrue(1 == 2) + self.assertRaises(err, "apt-key failed failed") def test_apt_source_ppa(self): @@ -160,7 +159,8 @@ class TestAptSourceConfig(TestCase): # file gets not created, might be permission or env detail contents = load_tfile_or_url(expected_sources_fn) print(contents) - self.assertTrue(1 == 2) + # intentional debug exit + self.assertRaises(ValueError) # vi: ts=4 expandtab |