summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/unittests/test_datasource/test_vmware.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/unittests/test_datasource/test_vmware.py b/tests/unittests/test_datasource/test_vmware.py
index 597db7c8..52f910b5 100644
--- a/tests/unittests/test_datasource/test_vmware.py
+++ b/tests/unittests/test_datasource/test_vmware.py
@@ -6,6 +6,10 @@
import base64
import gzip
+import os
+
+import pytest
+
from cloudinit import dmi, helpers, safeyaml
from cloudinit import settings
from cloudinit.sources import DataSourceVMware
@@ -16,7 +20,6 @@ from cloudinit.tests.helpers import (
populate_dir,
)
-import os
PRODUCT_NAME_FILE_PATH = "/sys/class/dmi/id/product_name"
PRODUCT_NAME = "VMware7,1"
@@ -56,6 +59,17 @@ runcmd:
"""
+@pytest.yield_fixture(autouse=True)
+def common_patches():
+ with mock.patch('cloudinit.util.platform.platform', return_value='Linux'):
+ with mock.patch.multiple(
+ 'cloudinit.dmi',
+ is_container=mock.Mock(return_value=False),
+ is_FreeBSD=mock.Mock(return_value=False)
+ ):
+ yield
+
+
class TestDataSourceVMware(CiTestCase):
"""
Test common functionality that is not transport specific.