refactored cli_test.py