I have written some unit tests using unittest in Python. However, they do not simply test objects in the conventional way - rather, they invoke another Python script by calling it using Popen. This is by design - it's a command line utility, so I want to test it as a user would, which includes things such as command-line options, etc.). To be clear, both the unit tests and the script to be tested are written in Python (v3 to be precise).
The script I am testing makes heavy use of datetime.now(), and ideally I would like to mock that value somehow so that I can keep it constant. All the examples I've seen of doing this, though (e.g. this one using mock) assume some form of white-box testing.
Is there a way for me to do this?