示例#1
0
 def test(self):
     """
     Test various inputs and see that they are correct.
     """
     self.assertEqual(misc._alignData(100, 100), (4, 25, 25))
     self.assertEqual(misc._alignData(512, 512), (512, 1, 1))
     self.assertEqual(misc._alignData(1, 1024), (1, 1, 1024))
     self.assertEqual(misc._alignData(10240, 512), (512, 20, 1))
     self.assertEqual(misc._alignData(1, 1), (1, 1, 1))
示例#2
0
文件: misc_test.py 项目: k0ste/vdsm
 def test(self):
     """
     Test various inputs and see that they are correct.
     """
     self.assertEqual(misc._alignData(100, 100), (4, 25, 25))
     self.assertEqual(misc._alignData(512, 512), (512, 1, 1))
     self.assertEqual(misc._alignData(1, 1024), (1, 1, 1024))
     self.assertEqual(misc._alignData(10240, 512), (512, 20, 1))
     self.assertEqual(misc._alignData(1, 1), (1, 1, 1))
示例#3
0
def test_align_data(length, offset, expected):
    alignment = misc._alignData(length, offset)
    assert alignment == expected
    for value in alignment:
        assert isinstance(value, int)