Fix tests for Python 2.7 use mock instead of unittest.mock