Move from os.environ['HOME'] to os.path.expanduser('~') for better coverage