Skip to content

Commit 1648746

Browse files
fix(test_vhdutil): mock getBlockSize
Signed-off-by: Mathieu Labourier <[email protected]>
1 parent bc71322 commit 1648746

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/test_vhdutil.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,12 @@ def test_function(args, inp):
413413
context.add_executable(VHD_UTIL, test_function)
414414

415415
# Act
416-
result = vhdutil.getAllocatedSize(TEST_VHD_NAME)
416+
result = 0
417+
with unittest.mock.patch(
418+
"vhdutil.getBlockSize",
419+
return_value=vhdutil.VHD_BLOCK_SIZE
420+
):
421+
result = vhdutil.getAllocatedSize(TEST_VHD_NAME)
417422

418423
# Assert
419424
self.assertEqual(18856*2*1024*1024, result)

0 commit comments

Comments
 (0)