Пример #1
0
 def testWrapAt2To3(self):
     start1 = 27
     start2 = 703
     result1 = list(storage.GetDiskLabels("", start1))
     result2 = \
         map(lambda x: x[1:],
             list(storage.GetDiskLabels("", start2, start=start2 - start1)))
     self.assertEqual(result1, result2)
 def testWrapAt2To3(self):
     start1 = 27
     start2 = 703
     result1 = list(storage.GetDiskLabels("", start1))
     result2 = [
         x[1:] for x in list(
             storage.GetDiskLabels("", start2, start=start2 - start1))
     ]
     self.assertEqual(result1, result2)
 def testEmptyPrefix(self):
     labels = [
         "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
         "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",
         "aa", "ab", "ac", "ad", "ae", "af", "ag", "ah", "ai", "aj", "ak",
         "al", "am", "an", "ao", "ap", "aq", "ar", "as", "at", "au", "av",
         "aw", "ax", "ay", "az", "ba", "bb", "bc", "bd", "be", "bf", "bg",
         "bh"
     ]
     result = list(storage.GetDiskLabels("", 60))
     self.assertEqual(labels, result)
 def testNormalPrefix(self):
     labels = [
         "/dev/sda", "/dev/sdb", "/dev/sdc", "/dev/sdd", "/dev/sde",
         "/dev/sdf", "/dev/sdg", "/dev/sdh", "/dev/sdi", "/dev/sdj",
         "/dev/sdk", "/dev/sdl", "/dev/sdm", "/dev/sdn", "/dev/sdo",
         "/dev/sdp", "/dev/sdq", "/dev/sdr", "/dev/sds", "/dev/sdt",
         "/dev/sdu", "/dev/sdv", "/dev/sdw", "/dev/sdx", "/dev/sdy",
         "/dev/sdz", "/dev/sdaa", "/dev/sdab", "/dev/sdac", "/dev/sdad",
         "/dev/sdae", "/dev/sdaf", "/dev/sdag", "/dev/sdah", "/dev/sdai",
         "/dev/sdaj", "/dev/sdak", "/dev/sdal", "/dev/sdam", "/dev/sdan",
         "/dev/sdao", "/dev/sdap", "/dev/sdaq", "/dev/sdar", "/dev/sdas",
         "/dev/sdat", "/dev/sdau", "/dev/sdav", "/dev/sdaw", "/dev/sdax",
         "/dev/sday", "/dev/sdaz", "/dev/sdba", "/dev/sdbb", "/dev/sdbc",
         "/dev/sdbd", "/dev/sdbe", "/dev/sdbf", "/dev/sdbg", "/dev/sdbh"
     ]
     result = list(storage.GetDiskLabels("/dev/sd", 60))
     self.assertEqual(labels, result)