CFY-287 fixed flake8 and assertions