Fix monkey-patching occurence in a test

A test of Resource class was using a direct monkey-patching of a
generic resource class without cleanup. This has not resulted in an error
so far, but surely might in the future.

This patch uses proper mock for patching instead.

Change-Id: I9134dfc625e12df1ebcacda8373f81737fd59c2c