Added comments and Mock patch in test.