Changeset 70855 in vbox for trunk/src/VBox/ValidationKit/tests/api/tdMoveMedium1.py
- Timestamp:
- Feb 2, 2018 1:52:40 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/api/tdMoveMedium1.py
r70854 r70855 91 91 sActualFilePath = oAttachment.medium.location 92 92 if not os.path.samefile(sFilePath, sActualFilePath): 93 reporter.log('medium location expected to be "%s" but is "%s"' ,(sFilePath, sActualFilePath))93 reporter.log('medium location expected to be "%s" but is "%s"' % (sFilePath, sActualFilePath)) 94 94 fRc = False; 95 95 if not os.path.exists(sFilePath): 96 reporter.log('medium file does not exist at "%s"' , (sFilePath))96 reporter.log('medium file does not exist at "%s"' % (sFilePath,)) 97 97 fRc = False; 98 98 return fRc … … 135 135 # attach HDD, IDE controller exists by default, but we use SATA just in case 136 136 sController='SATA Controller' 137 fRc = fRc and oSession.attachHd(sHddPath, sController, iPort = len(asFiles), fImmutable=False, fForceResource=False) 137 fRc = fRc and oSession.attachHd(sHddPath, sController, iPort = len(asFiles), 138 fImmutable=False, fForceResource=False) 138 139 if fRc: 139 140 asFiles.append(sFile) … … 157 158 #case 3. Path with file name 158 159 fRc = self.setLocation(os.path.join(sNewLoc, 'newName'), aoMediumAttachments) and fRc 159 asNewFiles = list(map(lambda s: 'newName' + os.path.splitext(s)[1], asFiles))160 asNewFiles = ['newName' + os.path.splitext(s)[1] for s in asFiles] 160 161 fRc = self.checkLocation(os.path.join(sNewLoc, 'newName'), aoMediumAttachments, asFiles) and fRc 161 162 # BUG! the check above succeeds, but it actually should be the one below which does … … 164 165 #case 4. Only file name 165 166 fRc = self.setLocation('onlyMediumName', aoMediumAttachments) and fRc 166 asNewFiles = list(map(lambda s: 'onlyMediumName' + os.path.splitext(s)[1], asFiles))167 asNewFiles = ['onlyMediumName' + os.path.splitext(s)[1] for s in asFiles] 167 168 fRc = self.checkLocation(os.path.join(sNewLoc, 'newName'), aoMediumAttachments, 168 list(map(lambda s: s.replace('.hdd', '.parallels'), asNewFiles))) and fRc169 [s.replace('.hdd', '.parallels') for s in asNewFiles]) and fRc 169 170 # BUG! due to the above path mishandling the check above succeeds, the directory issue is 170 171 # a consequence of the bug in case 3, but the extension is also picked incorrectly, it is … … 176 177 if fRc: 177 178 aoMediumAttachments = oVM.getMediumAttachmentsOfController(sController) 178 asSnapFiles = list(map(lambda o: os.path.basename(o.medium.name), aoMediumAttachments))179 asSnapFiles = [os.path.basename(o.medium.name) for o in aoMediumAttachments] 179 180 fRc = self.setLocation(sOrigLoc, aoMediumAttachments) and fRc 180 181 fRc = self.checkLocation(sOrigLoc, aoMediumAttachments, asSnapFiles) and fRc
Note:
See TracChangeset
for help on using the changeset viewer.