Skip to content

Commit dd23d64

Browse files
committed
Progress towards expanding accepted date formats
1 parent 3803a03 commit dd23d64

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

README.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,14 @@ This timeframe is not consistent on the real Vuforia Web Services.
185185
On the mock, this timeframe is three seconds by default.
186186
``MockVWS`` takes a parameter ``query_recognizes_deletion_seconds`` to change this.
187187

188+
Accepted date formats for the Query API
189+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
190+
191+
The Query API documentation is not clear on which date formats are expected exactly in the ``Date`` header.
192+
The mock is strict.
193+
That is, it accepts only a few date formats, and rejects all others.
194+
If you find a date format which is accepted by the real Query API but rejected by the mock, please create a GitHub issue.
195+
188196
.. |Build Status| image:: https://travis-ci.org/adamtheturtle/vws-python.svg?branch=master
189197
:target: https://travis-ci.org/adamtheturtle/vws-python
190198
.. |codecov| image:: https://codecov.io/gh/adamtheturtle/vws-python/branch/master/graph/badge.svg

src/mock_vws/_mock_web_query_api.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,12 @@ def validate_date_format(
299299
"""
300300
request, context = args
301301

302+
# We expect that more formats than this will be accepted.
303+
# These are the accepted ones we know of at the time of writing.
304+
known_accepted_formats = {
305+
'X'
306+
}
307+
302308
try:
303309
datetime.datetime.strptime(
304310
request.headers['Date'],

0 commit comments

Comments
 (0)