VirtualBox

Ignore:
Timestamp:
Feb 2, 2018 1:52:40 PM (7 years ago)
Author:
vboxsync
Message:

ValidationKit: address pylint issues

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/tests/api/tdMoveMedium1.py

    r70854 r70855  
    9191            sActualFilePath = oAttachment.medium.location
    9292            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))
    9494                fRc = False;
    9595            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,))
    9797                fRc = False;
    9898        return fRc
     
    135135                # attach HDD, IDE controller exists by default, but we use SATA just in case
    136136                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)
    138139                if fRc:
    139140                    asFiles.append(sFile)
     
    157158            #case 3. Path with file name
    158159            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]
    160161            fRc = self.checkLocation(os.path.join(sNewLoc, 'newName'), aoMediumAttachments, asFiles) and fRc
    161162            # BUG! the check above succeeds, but it actually should be the one below which does
     
    164165            #case 4. Only file name
    165166            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]
    167168            fRc = self.checkLocation(os.path.join(sNewLoc, 'newName'), aoMediumAttachments,
    168                                      list(map(lambda s: s.replace('.hdd', '.parallels'), asNewFiles))) and fRc
     169                                     [s.replace('.hdd', '.parallels') for s in asNewFiles]) and fRc
    169170            # BUG! due to the above path mishandling the check above succeeds, the directory issue is
    170171            # a consequence of the bug in case 3, but the extension is also picked incorrectly, it is
     
    176177            if fRc:
    177178                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]
    179180                fRc = self.setLocation(sOrigLoc, aoMediumAttachments) and fRc
    180181                fRc = self.checkLocation(sOrigLoc, aoMediumAttachments, asSnapFiles) and fRc
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette