summaryrefslogtreecommitdiff
path: root/tests/unittests/test_distros/test_sysconfig.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@gmail.com>2016-05-12 14:25:32 -0700
committerJoshua Harlow <harlowja@gmail.com>2016-05-12 14:25:32 -0700
commit78cbc764486060928541b9dee6ce5779e622d1fa (patch)
tree48a886ea0a9857ce353eebe504048e656e1c6e92 /tests/unittests/test_distros/test_sysconfig.py
parent690bdce9a73ec6d00b4eebbbca31cc527e7b2fce (diff)
parent811f7b5b3c4590ee4a16662db37b1f37541d9822 (diff)
downloadvyos-cloud-init-78cbc764486060928541b9dee6ce5779e622d1fa.tar.gz
vyos-cloud-init-78cbc764486060928541b9dee6ce5779e622d1fa.zip
Enable flake8 and fix a large amount of reported issues
Diffstat (limited to 'tests/unittests/test_distros/test_sysconfig.py')
-rw-r--r--tests/unittests/test_distros/test_sysconfig.py27
1 files changed, 14 insertions, 13 deletions
diff --git a/tests/unittests/test_distros/test_sysconfig.py b/tests/unittests/test_distros/test_sysconfig.py
index 03d89a10..8cb55522 100644
--- a/tests/unittests/test_distros/test_sysconfig.py
+++ b/tests/unittests/test_distros/test_sysconfig.py
@@ -1,6 +1,7 @@
import re
from cloudinit.distros.parsers.sys_conf import SysConf
+
from ..helpers import TestCase
@@ -27,34 +28,34 @@ IPV6TO4_ROUTING='eth0-:0004::1/64 eth1-:0005::1/64'
ETHTOOL_OPTS="-K ${DEVICE} tso on; -G ${DEVICE} rx 256 tx 256"
USEMD5=no'''
conf = SysConf(contents.splitlines())
- self.assertEquals(conf['HOSTNAME'], 'blahblah')
- self.assertEquals(conf['SHORTDATE'], '$(date +%y:%m:%d:%H:%M)')
+ self.assertEqual(conf['HOSTNAME'], 'blahblah')
+ self.assertEqual(conf['SHORTDATE'], '$(date +%y:%m:%d:%H:%M)')
# Should be unquoted
- self.assertEquals(conf['ETHTOOL_OPTS'], ('-K ${DEVICE} tso on; '
- '-G ${DEVICE} rx 256 tx 256'))
- self.assertEquals(contents, str(conf))
+ self.assertEqual(conf['ETHTOOL_OPTS'], ('-K ${DEVICE} tso on; '
+ '-G ${DEVICE} rx 256 tx 256'))
+ self.assertEqual(contents, str(conf))
def test_parse_shell_vars(self):
contents = 'USESMBAUTH=$XYZ'
conf = SysConf(contents.splitlines())
- self.assertEquals(contents, str(conf))
+ self.assertEqual(contents, str(conf))
conf = SysConf('')
conf['B'] = '${ZZ}d apples'
# Should be quoted
- self.assertEquals('B="${ZZ}d apples"', str(conf))
+ self.assertEqual('B="${ZZ}d apples"', str(conf))
conf = SysConf('')
conf['B'] = '$? d apples'
- self.assertEquals('B="$? d apples"', str(conf))
+ self.assertEqual('B="$? d apples"', str(conf))
contents = 'IPMI_WATCHDOG_OPTIONS="timeout=60"'
conf = SysConf(contents.splitlines())
- self.assertEquals('IPMI_WATCHDOG_OPTIONS=timeout=60', str(conf))
+ self.assertEqual('IPMI_WATCHDOG_OPTIONS=timeout=60', str(conf))
def test_parse_adjust(self):
contents = 'IPV6TO4_ROUTING="eth0-:0004::1/64 eth1-:0005::1/64"'
conf = SysConf(contents.splitlines())
# Should be unquoted
- self.assertEquals('eth0-:0004::1/64 eth1-:0005::1/64',
- conf['IPV6TO4_ROUTING'])
+ self.assertEqual('eth0-:0004::1/64 eth1-:0005::1/64',
+ conf['IPV6TO4_ROUTING'])
conf['IPV6TO4_ROUTING'] = "blah \tblah"
contents2 = str(conf).strip()
# Should be requoted due to whitespace
@@ -65,12 +66,12 @@ USEMD5=no'''
conf = SysConf(''.splitlines())
conf['B'] = ' $(time)'
contents = str(conf)
- self.assertEquals('B= $(time)', contents)
+ self.assertEqual('B= $(time)', contents)
def test_parse_empty(self):
contents = ''
conf = SysConf(contents.splitlines())
- self.assertEquals('', str(conf).strip())
+ self.assertEqual('', str(conf).strip())
def test_parse_add_new(self):
contents = 'BLAH=b'