summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/unittests/test_distros/test_resolv.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/unittests/test_distros/test_resolv.py b/tests/unittests/test_distros/test_resolv.py
index d947dda0..6b6ff6aa 100644
--- a/tests/unittests/test_distros/test_resolv.py
+++ b/tests/unittests/test_distros/test_resolv.py
@@ -38,8 +38,7 @@ class TestResolvHelper(MockerTestCase):
self.assertNotIn('10.3', rp.nameservers)
self.assertEquals(len(rp.nameservers), 3)
rp.add_nameserver('10.2')
- with self.assertRaises(ValueError):
- rp.add_nameserver('10.3')
+ self.assertRaises(ValueError, rp.add_nameserver, '10.3')
self.assertNotIn('10.3', rp.nameservers)
def test_search_domains(self):
@@ -58,6 +57,5 @@ class TestResolvHelper(MockerTestCase):
self.assertEquals(len(rp.search_domains), 5)
rp.add_search_domain('bbb4.y.com')
self.assertEquals(len(rp.search_domains), 6)
- with self.assertRaises(ValueError):
- rp.add_search_domain('bbb5.y.com')
+ self.assertRaises(ValueError, rp.add_search_domain, 'bbb5.y.com')
self.assertEquals(len(rp.search_domains), 6)