Revision b669aa41 test/py/ganeti.utils.storage_unittest.py
b/test/py/ganeti.utils.storage_unittest.py | ||
---|---|---|
106 | 106 |
self.assertTrue(constants.ST_LVM_PV in [st for (st, sk) in storage_units]) |
107 | 107 |
|
108 | 108 |
|
109 |
class TestGetStorageUnits(unittest.TestCase): |
|
110 |
|
|
111 |
def setUp(self): |
|
112 |
storage._GetDefaultStorageUnitForDiskTemplate = \ |
|
113 |
mock.Mock(return_value=("foo", "bar")) |
|
114 |
self._cfg = mock.Mock() |
|
115 |
|
|
116 |
def testGetStorageUnits(self): |
|
117 |
disk_templates = [constants.DT_FILE, constants.DT_SHARED_FILE] |
|
118 |
storage_units = storage.GetStorageUnits(self._cfg, disk_templates) |
|
119 |
self.assertEqual(len(storage_units), len(disk_templates)) |
|
120 |
|
|
121 |
def testGetStorageUnitsLvm(self): |
|
122 |
disk_templates = [constants.DT_PLAIN, constants.DT_DRBD8] |
|
123 |
storage_units = storage.GetStorageUnits(self._cfg, disk_templates) |
|
124 |
self.assertEqual(len(storage_units), len(disk_templates) + 1) |
|
125 |
|
|
126 |
|
|
109 | 127 |
class TestLookupSpaceInfoByStorageType(unittest.TestCase): |
110 | 128 |
|
111 | 129 |
def setUp(self): |
Also available in: Unified diff