def test_GetFormattedSoftwareListFileNotFound(self): # Create list of SoftwareItem objects vSWItemList = [] vSWItem = FileFunctions.SoftwareItem("MissingFile") vSWItemList.append(vSWItem) vExpectedResult = [] vPcName = "CPT1-EUD-D00191" # Mock method for IsOnline FileFunctions.IsOnline = MagicMock(return_value=0) # Mock method for CheckFile FileFunctions.CheckFile = MagicMock(return_value=False) vActualResult = FileFunctions.GetFormattedSoftwareList(vPcName, vSWItemList) self.assertCountEqual(vActualResult, vExpectedResult, "The Lists are not the same.")
def test_GetFormattedSoftwareListWithNoPcName(self): # Create list of SoftwareItem objects vSWItemList = [] vSWItem = FileFunctions.SoftwareItem("800-A0443_SBB_ANTENNA_ON_AIR_FTP") vSWItemList.append(vSWItem) # vSWItem = FileFunctions.SoftwareItem("800-A0582_SCM_HASS_Test_Script") # vSWItemList.append(vSWItem) vExpectedResult = [] vPcName = "" # Mock method for IsOnline FileFunctions.IsOnline = MagicMock(return_value=3) vActualResult = FileFunctions.GetFormattedSoftwareList(vPcName, vSWItemList) self.assertCountEqual(vActualResult, vExpectedResult, "The Lists are not the same.")