Fix Azure guest agent unit test

os_getenv mock needs to have a string return value.

Change-Id: Icc9717edeed6d881dfa987438ac8f73ddb333c69
This commit is contained in:
Adrian Vladu 2019-06-18 20:20:12 +03:00
parent 5f4df7040d
commit 8de552f104

View File

@ -80,6 +80,7 @@ class AzureGuestAgentPluginTest(unittest.TestCase):
mock_exists, mock_rmtree):
mock_rmtree.side_effect = (None, Exception)
mock_exists.return_value = True
mock_os_getenv.return_value = "fake_path"
with self.snatcher:
self._azureagentplugin._remove_azure_dirs()
mock_os_getenv.assert_called_with("SystemDrive")