lib.operating_system
- class dt4test.lib.operating_system.OPSystem[source]
- 本地进程操作
- append_to_environment_variable(name, *values, **config)[source]
追加环境变量
If the environment variable already exists, values are added after it, and otherwise a new environment variable is created.
- get_modified_time(path, format='timestamp')[source]
取得修改时间
How time is returned is determined based on the given
formatstring as follows. Note that all checks are case-insensitive. Returned time is also automatically logged.If
formatcontains the wordepoch, the time is returned in seconds after the UNIX epoch. The return value is always an integer.If
formatcontains any of the wordsyear,month,day,hour,minorsec, only the selected parts are returned. The order of the returned parts is always the one in the previous sentence and the order of the words informatis not significant. The parts are returned as zero-padded strings (e.g. May ->05).Otherwise, and by default, the time is returned as a timestamp string in the format
2006-02-24 15:08:31.
- set_modified_time(path, mtime)[source]
设置修改时间
Changes the modification and access times of the given file to the value determined by
mtime. The time can be given in different formats described below. Note that all checks involving strings are case-insensitive. Modified time can only be set to regular files.If
mtimeis a number, or a string that can be converted to a number, it is interpreted as seconds since the UNIX epoch (1970-01-01 00:00:00 UTC). This documentation was originally written about 1177654467 seconds after the epoch.If
mtimeis a timestamp, that time will be used. Valid timestamp formats areYYYY-MM-DD hh:mm:ssandYYYYMMDD hhmmss.If
mtimeis equal toNOW, the current local time is used.If
mtimeis equal toUTC, the current time in [http://en.wikipedia.org/wiki/Coordinated_Universal_Time|UTC] is used.If
mtimeis in the format likeNOW - 1 dayorUTC + 1 hour 30 min, the current local/UTC time plus/minus the time specified with the time string is used. The time string format is described in an appendix of Robot Framework User Guide.