Open 4myhw opened 3 years ago
Thanks for spotting the inverted lines of code. As for the first one, my original intention was to explain that we shall not patch the original module, but the imported one, and I realise that I mixed this concept with the strategies to patch dates. I will fix it asap (it requires changing the code of the package as well)
Currently the patch for datetime.now that illustrates the TypeError is:
@patch('datetime.datetime.now')
Should it be:@patch('fileinfo.logger.datetime.datetime.now')
The other is very minor and not an error just something to make things simpler. The order of lines of code was switched while you were demonstrating multiple with statements. Just in case someone agrees with you and thinks assert_called_with is less awkward then multiple withs and skips to the next piece of code:
Under Multiple patches:
Under Checking call parameters: