def test_add_sudo(): tmpuser = config.core.user try: config.core.user = '******' assert utils.add_sudo('ls').startswith('sudo') config.core.user = '' assert utils.add_sudo('ls') == 'ls' finally: config.core.user = tmpuser