summaryrefslogtreecommitdiff
path: root/tests/unittests/test_distros/test_resolv.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2016-05-12 16:43:11 -0400
committerScott Moser <smoser@ubuntu.com>2016-05-12 16:43:11 -0400
commit4ba4df2f00ab1763920280f76e2b4497898858af (patch)
treef025371acd895680336026ebdff7ffa8a4db25d3 /tests/unittests/test_distros/test_resolv.py
parentf6b318947d0be752e7c93708413929802006a66e (diff)
downloadvyos-cloud-init-4ba4df2f00ab1763920280f76e2b4497898858af.tar.gz
vyos-cloud-init-4ba4df2f00ab1763920280f76e2b4497898858af.zip
run flake8 instead of pyflakes in tox. expect tests/ to pass flake8.
Diffstat (limited to 'tests/unittests/test_distros/test_resolv.py')
-rw-r--r--tests/unittests/test_distros/test_resolv.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/unittests/test_distros/test_resolv.py b/tests/unittests/test_distros/test_resolv.py
index 9edeb6e7..9402b5ea 100644
--- a/tests/unittests/test_distros/test_resolv.py
+++ b/tests/unittests/test_distros/test_resolv.py
@@ -1,9 +1,10 @@
from cloudinit.distros.parsers import resolv_conf
from cloudinit.distros import rhel_util
+from ..helpers import TestCase
+
import re
import tempfile
-from ..helpers import TestCase
BASE_RESOLVE = '''
@@ -19,7 +20,7 @@ class TestResolvHelper(TestCase):
def test_parse_same(self):
rp = resolv_conf.ResolvConf(BASE_RESOLVE)
rp_r = str(rp).strip()
- self.assertEquals(BASE_RESOLVE, rp_r)
+ self.assertEqual(BASE_RESOLVE, rp_r)
def test_write_works(self):
with tempfile.NamedTemporaryFile() as fh:
@@ -27,10 +28,10 @@ class TestResolvHelper(TestCase):
def test_local_domain(self):
rp = resolv_conf.ResolvConf(BASE_RESOLVE)
- self.assertEquals(None, rp.local_domain)
+ self.assertEqual(None, rp.local_domain)
rp.local_domain = "bob"
- self.assertEquals('bob', rp.local_domain)
+ self.assertEqual('bob', rp.local_domain)
self.assertIn('domain bob', str(rp))
def test_nameservers(self):
@@ -41,7 +42,7 @@ class TestResolvHelper(TestCase):
self.assertIn('10.2', rp.nameservers)
self.assertIn('nameserver 10.2', str(rp))
self.assertNotIn('10.3', rp.nameservers)
- self.assertEquals(len(rp.nameservers), 3)
+ self.assertEqual(len(rp.nameservers), 3)
rp.add_nameserver('10.2')
self.assertRaises(ValueError, rp.add_nameserver, '10.3')
self.assertNotIn('10.3', rp.nameservers)
@@ -55,12 +56,12 @@ class TestResolvHelper(TestCase):
self.assertTrue(re.search(r'search(.*)bbb.y.com(.*)', str(rp)))
self.assertIn('bbb.y.com', rp.search_domains)
rp.add_search_domain('bbb.y.com')
- self.assertEquals(len(rp.search_domains), 3)
+ self.assertEqual(len(rp.search_domains), 3)
rp.add_search_domain('bbb2.y.com')
- self.assertEquals(len(rp.search_domains), 4)
+ self.assertEqual(len(rp.search_domains), 4)
rp.add_search_domain('bbb3.y.com')
- self.assertEquals(len(rp.search_domains), 5)
+ self.assertEqual(len(rp.search_domains), 5)
rp.add_search_domain('bbb4.y.com')
- self.assertEquals(len(rp.search_domains), 6)
+ self.assertEqual(len(rp.search_domains), 6)
self.assertRaises(ValueError, rp.add_search_domain, 'bbb5.y.com')
- self.assertEquals(len(rp.search_domains), 6)
+ self.assertEqual(len(rp.search_domains), 6)