You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If it needs to the exact current time, that will be challenging as currently gabbi doesn't know what time it is. It also depends on how you need the date to be formatted. If you're okay with a number of seconds there may be some tricks you can do, but if you need to use formatted date strings, doing datetime math is not something that currently can be done within the yaml.
Depending on your environment you could set a timestamp in an environment variable and then reference that using the $ENVIRON susbtitution. Then in a subsequent test you might be able to use jsonpath_rw_ext to do some math, if the time showed up in the response.
A bit easier would be to have two static times in the environ, one for "now" and one for "later" and reference them with $ENVIRON, without the math.
If you're testing from with a test harness you might be able to set up a fixture that allows you make a request to a simple wsgi app that gives you the times you want that you can then use in a test to a different wsgi app. The simple wsgi app in gabbi's test do some things in this vein.
If the code you're trying to test is public somewhere and you can point me at it, I might be able to give you some other ideas on how to do what you want.
I have a use case to pass current timestamp as HTTP post. Also I would like to add some hours to that and post again. How can I achieve this?
The text was updated successfully, but these errors were encountered: