Mercurial > public > mercurial-scm > hg
comparison tests/common-pattern.py @ 37008:16203c6079e7
tests: use $HTTP_DATE$ for Date header
Support for the $HTTP_DATE$ substitution was recently added. Let's
adopt it more widely.
We had to tweak the substitution to be case insensitive, since
HTTP headers are case insensitive. I also found a minor test
issue not globbing over the length of the Server response header.
Differential Revision: https://phab.mercurial-scm.org/D2839
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Tue, 13 Mar 2018 08:58:52 -0700 |
parents | 2090044a288d |
children | 28e8c5949109 |
comparison
equal
deleted
inserted
replaced
37007:143219fc2620 | 37008:16203c6079e7 |
---|---|
74 # HTTP log dates | 74 # HTTP log dates |
75 (br' - - \[\d\d/.../2\d\d\d \d\d:\d\d:\d\d] "(GET|PUT|POST)', | 75 (br' - - \[\d\d/.../2\d\d\d \d\d:\d\d:\d\d] "(GET|PUT|POST)', |
76 lambda m: br' - - [$LOGDATE$] "' + m.group(1) | 76 lambda m: br' - - [$LOGDATE$] "' + m.group(1) |
77 ), | 77 ), |
78 # HTTP header dates- RFC 1123 | 78 # HTTP header dates- RFC 1123 |
79 (br'Date: [A-Za-z]{3}, \d\d [A-Za-z]{3} \d{4} \d\d:\d\d:\d\d GMT', | 79 (br'([Dd]ate): [A-Za-z]{3}, \d\d [A-Za-z]{3} \d{4} \d\d:\d\d:\d\d GMT', |
80 br'Date: $HTTP_DATE$' | 80 lambda m: br'%s: $HTTP_DATE$' % m.group(1) |
81 ), | 81 ), |
82 # LFS expiration value | 82 # LFS expiration value |
83 (br'"expires_at": "\d{4}-\d\d-\d\dT\d\d:\d\d:\d\dZ"', | 83 (br'"expires_at": "\d{4}-\d\d-\d\dT\d\d:\d\d:\d\dZ"', |
84 br'"expires_at": "$ISO_8601_DATE_TIME$"' | 84 br'"expires_at": "$ISO_8601_DATE_TIME$"' |
85 ), | 85 ), |