extract duplicate string intests to classmethod
Code style: use logger and avoid misinterpreting error situation