예제 #1
0
 def test_create_part(self, mock_create_part):
     parts = diskparts.PartitionsModel()
     dev = '/dev/sdb'
     size = 10
     params = {'devname': dev, 'partsize': size}
     parts.create(params)
     mock_create_part.return_value = 'sdb1'
     mock_create_part.assert_called_with(dev, size)
예제 #2
0
 def test_create_part_missing_device(self):
     parts = diskparts.PartitionsModel()
     size = 10
     params = {'partsize': size}
     self.assertRaises(MissingParameter, parts.create, params)
예제 #3
0
 def test_create_part_missing_size(self):
     parts = diskparts.PartitionsModel()
     dev = '/dev/sdb'
     params = {'devname': dev}
     self.assertRaises(MissingParameter, parts.create, params)
예제 #4
0
 def test_get_part_list(self):
     parts = diskparts.PartitionsModel()
     parts_list = parts.get_list()
     self.assertGreaterEqual(len(parts_list), 0)