def test_cannot_save_if_size_larger_than_volume_group(self):
filesystem_group = factory.make_FilesystemGroup(
group_type=FILESYSTEM_GROUP_TYPE.LVM_VG)
factory.make_VirtualBlockDevice(
filesystem_group=filesystem_group,
size=filesystem_group.get_size() / 2)
new_block_device_size = filesystem_group.get_size()
human_readable_size = human_readable_bytes(new_block_device_size)
with ExpectedException(
ValidationError,
re.escape(
"{'__all__': ['There is not enough free space (%s) "
"on volume group %s.']}" % (
human_readable_size,
filesystem_group.name,
))):
factory.make_VirtualBlockDevice(
filesystem_group=filesystem_group,
size=new_block_device_size)
评论列表
文章目录