How to test a game that uses OS.get_datetime() without messing around with my OS time settings?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By pbaggers
:bust_in_silhouette: Reply From: jgodfrey

I’d probably just write a replacement function that returns whatever date/time values you want to test against (in a format that matches the values returned by get_datetime()). Then, for testing, just replace the calls to the real function with calls to your replacement function. That way, you can easily test against any date/time value(s) you want.

Thanks. This works just fine for me! I used OS.get_feature(“standalone”) to differentiate between functions.

pbaggers | 2020-08-06 08:44