use unittest.mock
delete borrowed
fix tests for run.py