<div dir="ltr"><div><div><div><div><div><deepakcs> Hi, whats the right way to mock the LOG variable inside the driver ? I am mocking mock.patch.object(glusterfs, 'LOG') as mock_logger<br><deepakcs> and then doing...<br>
<deepakcs> mock_logger.warning.assert_called_once() - which passes and is expected to pass per my code<br><deepakcs> but<br><deepakcs> mock_logger.debug.assert_called_once() - shud fail , but this also passes !<br>
<deepakcs> any idea why ?<br><br></div>I feel that I am not mocking the LOG inside the driver correctly.<br><br>I also tried<br> mock.patch.object(glusterfs.LOG, 'warning'),<br> mock.patch.object(glusterfs.LOG, 'debug')<br>
</div>as mock_logger_warn and mock_logger_debug respectively<br><br></div>But here too<br></div>.debug and .warning both passes.. while the expected result is for .warning to pass and .debug to fail<br><br></div>So somehow I am unable to mock LOG properly<br>
<br>thanx,<br>deepak<br></div>