summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian C. Lane <bcl@redhat.com>2012-08-08 09:01:42 -0700
committerBrian C. Lane <bcl@redhat.com>2012-08-09 08:22:27 -0700
commit58728f08187dcca003036d0d58cff62d5e3f44ee (patch)
treea9539506b62b4da1529a0167fbfa44d37301071f
parent16a7c6e7af3df4816323a007f785155d307869bf (diff)
downloadanaconda-58728f08187dcca003036d0d58cff62d5e3f44ee.tar.gz
anaconda-58728f08187dcca003036d0d58cff62d5e3f44ee.tar.xz
anaconda-58728f08187dcca003036d0d58cff62d5e3f44ee.zip
tests: cleanup whitespace in simpleconfig_test.py
-rw-r--r--tests/pyanaconda_test/simpleconfig_test.py42
1 files changed, 21 insertions, 21 deletions
diff --git a/tests/pyanaconda_test/simpleconfig_test.py b/tests/pyanaconda_test/simpleconfig_test.py
index 467e993aa..ab59f5d83 100644
--- a/tests/pyanaconda_test/simpleconfig_test.py
+++ b/tests/pyanaconda_test/simpleconfig_test.py
@@ -6,13 +6,13 @@ import sys
class SimpleconfigTest(mock.TestCase):
def setUp(self):
- self.setupModules(["_isys", "block", "ConfigParser"])
+ self.setupModules(["_isys", "block", "ConfigParser"])
self.fs = mock.DiskIO()
import pyanaconda.simpleconfig
pyanaconda.simpleconfig.open = self.fs.open
pyanaconda.simpleconfig.os = mock.Mock() # Mock os module
pyanaconda.simpleconfig.os.path = os.path # except os.path part
-
+
# Stuff for IfcfgFile class tests
self.DIR = '/etc/sysconfig/network-scripts/'
self.IFACE = 'eth0'
@@ -20,12 +20,12 @@ class SimpleconfigTest(mock.TestCase):
self.CONTENT = '# Broadcom Corporation NetXtreme BCM5761 Gigabit Ethernet\n'
self.CONTENT += 'DEVICE=eth0\n'
self.CONTENT += 'HWADDR=00:10:18:61:35:98\n'
- self.CONTENT += 'ONBOOT=no\n'
- self.fs.open(self.PATH, 'w').write(self.CONTENT)
-
+ self.CONTENT += 'ONBOOT=no\n'
+ open(self.PATH, 'w').write(self.CONTENT)
+
def tearDown(self):
self.tearDownModules()
-
+
def uppercase_ascii_string_letters_test(self):
"""Converting to uppercase (letters)"""
import pyanaconda.simpleconfig
@@ -35,13 +35,13 @@ class SimpleconfigTest(mock.TestCase):
self.assertEqual(ret, 'ABCD')
ret = pyanaconda.simpleconfig.uppercase_ASCII_string('ABCD')
self.assertEqual(ret, 'ABCD')
-
+
def uppercase_ascii_string_numbers_test(self):
"""Converting to uppercase (numbers)"""
import pyanaconda.simpleconfig
ret = pyanaconda.simpleconfig.uppercase_ASCII_string('123')
self.assertEqual(ret, '123')
-
+
def uppercase_ascii_string_others_test(self):
"""Converting to uppercase (special chars)"""
import pyanaconda.simpleconfig
@@ -51,7 +51,7 @@ class SimpleconfigTest(mock.TestCase):
self.assertEqual(ret, ' ')
ret = pyanaconda.simpleconfig.uppercase_ASCII_string('')
self.assertEqual(ret, '')
-
+
def set_and_get_test(self):
"""Setting and getting values"""
import pyanaconda.simpleconfig
@@ -64,7 +64,7 @@ class SimpleconfigTest(mock.TestCase):
self.assertEqual(scf.get('KEY3'), 'value3')
scf.set(('key4', 'value4'))
self.assertEqual(scf.get('KEY4'), 'value4')
-
+
def unset_test(self):
import pyanaconda.simpleconfig
scf = pyanaconda.simpleconfig.SimpleConfigFile()
@@ -78,22 +78,22 @@ class SimpleconfigTest(mock.TestCase):
scf.set(('key1', 'value1'))
scf.write('/tmp/file')
self.assertEqual(self.fs['/tmp/file'], 'KEY1="value1"\n')
-
+
def read_test(self):
import pyanaconda.simpleconfig
scf = pyanaconda.simpleconfig.SimpleConfigFile()
self.fs.open('/tmp/file', 'w').write('KEY1="value1"\n')
scf.read('/tmp/file')
self.assertEqual(scf.get('key1'), 'value1')
-
+
def ifcfgfile_path_property_test(self):
import pyanaconda.simpleconfig
- scf = pyanaconda.simpleconfig.IfcfgFile(self.DIR, self.IFACE)
- self.assertEqual(scf.path, self.PATH)
-
+ scf = pyanaconda.simpleconfig.IfcfgFile(self.DIR, self.IFACE)
+ self.assertEqual(scf.path, self.PATH)
+
def ifcfgfile_read_test(self):
- import pyanaconda.simpleconfig
- scf = pyanaconda.simpleconfig.IfcfgFile(self.DIR, self.IFACE)
+ import pyanaconda.simpleconfig
+ scf = pyanaconda.simpleconfig.IfcfgFile(self.DIR, self.IFACE)
scf.read()
self.assertEqual(scf.get('device'), 'eth0')
self.assertEqual(scf.get('hwaddr'), '00:10:18:61:35:98')
@@ -107,7 +107,7 @@ class SimpleconfigTest(mock.TestCase):
self.assertEqual(scf.get('device'), '')
self.assertEqual(scf.get('hwaddr'), '')
self.assertEqual(scf.get('onboot'), '')
-
+
def ifcfgfile_write_test(self):
import pyanaconda.simpleconfig
scf = pyanaconda.simpleconfig.IfcfgFile(self.DIR, self.IFACE)
@@ -115,6 +115,6 @@ class SimpleconfigTest(mock.TestCase):
scf.set(('hwaddr', '00:11:22:33:44:55'))
scf.set(('onboot', 'no'))
scf.write()
- self.assertEqual(self.fs[self.PATH],
- 'DEVICE="eth0"\nHWADDR="00:11:22:33:44:55"\nONBOOT="no"\n')
-
+ self.assertEqual(open(self.PATH).read(),
+ 'DEVICE="eth0"\nHWADDR="00:11:22:33:44:55"\nONBOOT="no"\n')
+