Mercurial > public > mercurial-scm > hg-stable
diff tests/common-pattern.py @ 36930:03368431f014
tests: add a substitution pattern for dates in HTTP headers and LFS payload
This will be useful when printing HTTP headers and JSON payload received from an
LFS server. The RFC 1123 date masking has uses elsewhere too.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sat, 24 Feb 2018 15:12:01 -0500 |
parents | 003ae586a02e |
children | 2090044a288d |
line wrap: on
line diff
--- a/tests/common-pattern.py Mon Mar 12 21:50:18 2018 -0400 +++ b/tests/common-pattern.py Sat Feb 24 15:12:01 2018 -0500 @@ -72,6 +72,14 @@ (br' - - \[\d\d/.../2\d\d\d \d\d:\d\d:\d\d] "(GET|PUT|POST)', lambda m: br' - - [$LOGDATE$] "' + m.group(1) ), + # HTTP header dates- RFC 1123 + (br'Date: [A-Za-z]{3}, \d\d [A-Za-z]{3} \d{4} \d\d:\d\d:\d\d GMT', + br'Date: $HTTP_DATE$' + ), + # LFS expiration value + (br'"expires_at": "\d{4}-\d\d-\d\dT\d\d:\d\d:\d\dZ"', + br'"expires_at": "$ISO_8601_DATE_TIME$"' + ), # Windows has an extra '/' in the following lines that get globbed away: # pushing to file:/*/$TESTTMP/r2 (glob) # comparing with file:/*/$TESTTMP/r2 (glob)