def test_devname_to_index(self): self.assertEqual(devname_to_index('a'), 0) self.assertEqual(devname_to_index('b'), 1) self.assertEqual(devname_to_index('aa'), 26) self.assertEqual(devname_to_index('ab'), 27) self.assertEqual(devname_to_index('z'), 25) self.assertEqual(devname_to_index('zz'), 701) self.assertEqual(devname_to_index('zzz'), 18277)
def test_index_to_devname_and_back(self): for i in range(18277): self.assertEqual(i, devname_to_index(index_to_devname(i)))