diff options
author | Cole Robinson <crobinso@redhat.com> | 2013-04-13 14:34:52 -0400 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2013-04-13 15:22:43 -0400 |
commit | 0d243983d011dc4eb4af231f0a118ce93eabb526 (patch) | |
tree | fc72bf72975445c4f315be55a6e0fcf9fa1f5c25 /tests/storage.py | |
parent | fcc680cae13df1bac2a51e871cbc1a0d42ee7f0b (diff) | |
download | virt-manager-0d243983d011dc4eb4af231f0a118ce93eabb526.tar.gz |
Revive pep8 and clean up the code
autopep8 is pretty cool :)
Diffstat (limited to 'tests/storage.py')
-rw-r--r-- | tests/storage.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/storage.py b/tests/storage.py index 35d654d1..de530eba 100644 --- a/tests/storage.py +++ b/tests/storage.py @@ -28,6 +28,7 @@ import libvirt basepath = os.path.join(os.getcwd(), "tests", "storage-xml") + def generate_uuid_from_string(msg): res = msg.split("-", 1) @@ -44,6 +45,7 @@ def generate_uuid_from_string(msg): return numstr + def _findFreePoolName(conn, namebase): i = 0 @@ -55,6 +57,7 @@ def _findFreePoolName(conn, namebase): except: return poolname + def createPool(conn, ptype, poolname=None, fmt=None, target_path=None, source_path=None, source_name=None, uuid=None, iqn=None): poolclass = StoragePool.get_pool_class(ptype) @@ -82,6 +85,7 @@ def createPool(conn, ptype, poolname=None, fmt=None, target_path=None, return poolCompare(pool_inst) + def poolCompare(pool_inst): filename = os.path.join(basepath, pool_inst.name + ".xml") out_expect = pool_inst.get_xml_config() @@ -92,10 +96,11 @@ def poolCompare(pool_inst): return pool_inst.install(build=True, meter=None, create=True) + def createVol(poolobj, volname=None, input_vol=None, clone_vol=None): volclass = StorageVolume.get_volume_for_pool(pool_object=poolobj) - if volname == None: + if volname is None: volname = poolobj.name() + "-vol" alloc = 5 * 1024 * 1024 * 1024 @@ -125,6 +130,7 @@ def createVol(poolobj, volname=None, input_vol=None, clone_vol=None): return vol_inst.install(meter=False) + class TestStorage(unittest.TestCase): def setUp(self): @@ -166,7 +172,7 @@ class TestStorage(unittest.TestCase): # Test creating with many devices createPool(self.conn, StoragePool.TYPE_LOGICAL, "pool-logical-manydev", - source_path=[ "/tmp/path1", "/tmp/path2", "/tmp/path3" ], + source_path=["/tmp/path1", "/tmp/path2", "/tmp/path3"], target_path=None) def testDiskPool(self): |