* morituri/common/drive.py:
If cdio.get_devices_with_cap finds a single drive, it returns a str instead of a list. Work around that bug. Fixes #102. * morituri/test/test_common_drive.py (added): * morituri/test/Makefile.am: Add test for it. Caught a bug in my first implementation, too!
This commit is contained in:
16
morituri/test/test_common_drive.py
Normal file
16
morituri/test/test_common_drive.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# -*- Mode: Python; test-case-name: morituri.test.test_common_drive -*-
|
||||
# vi:si:et:sw=4:sts=4:ts=4
|
||||
|
||||
from morituri.test import common
|
||||
from morituri.common import drive
|
||||
|
||||
class ListifyTestCase(common.TestCase):
|
||||
|
||||
def testString(self):
|
||||
string = '/dev/sr0'
|
||||
self.assertEquals(drive._listify(string), [string, ])
|
||||
|
||||
def testList(self):
|
||||
lst = ['/dev/scd0', '/dev/sr0']
|
||||
self.assertEquals(drive._listify(lst), lst)
|
||||
|
||||
Reference in New Issue
Block a user