diff options
author | Scott Moser <smoser@ubuntu.com> | 2016-05-27 09:55:10 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2016-05-27 09:55:10 -0400 |
commit | 318bd66461cba2f480b2ef6be119d2fcd5c6e9c0 (patch) | |
tree | 1817b310efc0190c92c5c95b15df6491119233ce /tests/unittests/test_distros/test_sysconfig.py | |
parent | 949cebd48c9100d4fd00b74232bcf048980e6e0d (diff) | |
parent | 0dbe69aa34948d73d5709a7ddc19389e05e1a268 (diff) | |
download | vyos-cloud-init-318bd66461cba2f480b2ef6be119d2fcd5c6e9c0.tar.gz vyos-cloud-init-318bd66461cba2f480b2ef6be119d2fcd5c6e9c0.zip |
merge from trunk
Diffstat (limited to 'tests/unittests/test_distros/test_sysconfig.py')
-rw-r--r-- | tests/unittests/test_distros/test_sysconfig.py | 27 |
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' |