fix tests import and code formatting