VirtualBox

Changeset 84498 in vbox for trunk/src


Ignore:
Timestamp:
May 25, 2020 1:00:24 PM (5 years ago)
Author:
vboxsync
Message:

TestManager/*base.py: Tweaked the month validation for relative timestamps from the xxxx-ago combo box.

Location:
trunk/src/VBox/ValidationKit/testmanager
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/testmanager/core/base.py

    r84271 r84498  
    616616
    617617    @staticmethod
    618     def validateTs(sValue, aoNilValues = tuple([None, '']), fAllowNull = True):
     618    def validateTs(sValue, aoNilValues = tuple([None, '']), fAllowNull = True, fRelative = False):
    619619        """ Validates a timestamp field. """
    620620        if sValue in aoNilValues:
     
    653653                iHour  = int(oRes.group(4));
    654654                iSec   = int(oRes.group(5));
    655                 if iMonth > 12 or iMonth <= 0:
     655                if iMonth > 12 or (iMonth <= 0 and not fRelative):
    656656                    sError = 'Invalid timestamp month.';
    657657                elif iDay > acDaysOfMonth[iMonth - 1]:
  • trunk/src/VBox/ValidationKit/testmanager/webui/wuibase.py

    r83430 r84498  
    634634        #
    635635        chSign = sValue[0];
    636         (sValue, sError) = ModelDataBase.validateTs(sValue[1:]);
     636        (sValue, sError) = ModelDataBase.validateTs(sValue[1:], fRelative = True);
    637637        if sError is not None:
    638638            raise WuiException('%s parameter "%s" ("%s") is invalid: %s' % (self._sAction, sName, sValue, sError));
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