def test_poseidonshell(): shell = PoseidonShell() shell.do_record('foo.txt') shell.do_record('') shell.do_help('foo') shell.do_help('') shell.do_show('foo') shell.do_show('all') shell.do_show('history 10') shell.do_show('history') shell.do_show('role') shell.do_show('role developer-workstation') shell.do_show('') shell.do_task('foo') shell.do_task('') shell.do_task('clear') shell.do_task('clear 10') shell.do_quit('foo') shell.do_exit('foo') shell.do_playback('foo.txt') shell.do_playback('') shell.complete_show('foo', 'foo bar', 1, 1) shell.complete_task('foo', 'foo bar', 1, 1) shell.show_all('foo', []) shell.show_role('foo', []) shell.show_state('foo', []) shell.show_behavior('foo', []) shell.show_os('foo', []) shell.show_what('foo', []) shell.show_history('foo', []) shell.show_where('foo', []) shell.help_show() shell.show_authors('foo', []) shell.task_set('foo', []) shell.task_collect('foo', []) shell.task_ignore('foo', []) shell.task_clear('foo', []) shell.task_remove('foo', []) shell.task_remove('ignored', []) shell.task_remove('inactive', []) shell.help_task() shell.emptyline() shell.completenames('foo') shell.completenames('eof') shell.completenames('shell') shell.do_shell('ls') shell.precmd('foo') shell.precmd('foo ?') shell.do_eof('foo') shell.close() foo = open('foo.txt', 'w') shell.file = foo shell.precmd('foo')
def test_poseidonshell(): shell = PoseidonShell() shell.do_help('foo') shell.do_help('') shell.do_show('foo') shell.do_show('all') shell.do_show('history 10') shell.do_show('history') shell.do_show('role') shell.do_show('role developer-workstation') shell.do_show('') shell.do_task('foo') shell.do_task('') shell.do_task('clear') shell.do_task('clear 10') shell.do_quit('foo') shell.do_exit('foo') shell.complete_show('foo', 'foo bar', 1, 1) shell.complete_task('foo', 'foo bar', 1, 1) shell.show_all('foo', []) shell.show_role('foo', []) shell.show_state('foo', []) shell.show_behavior('foo', []) shell.show_os('foo', []) shell.show_what('foo', []) shell.show_history('foo', []) shell.show_where('foo', []) shell.help_show() shell.show_authors('foo', []) shell.task_set('foo', []) shell.task_collect('foo', []) shell.task_ignore('foo', []) shell.task_clear('foo', []) shell.task_remove('foo', []) shell.task_remove('ignored', []) shell.task_remove('inactive', []) shell.help_task() shell.emptyline() shell.do_shell('ls')
def test_poseidonshell(): shell = PoseidonShell() shell.do_record('foo.txt') shell.do_what('foo') shell.complete_show('foo', 'what ok yeah', 0, 1) shell.complete_history('foo', 'what ok yeah', 0, 1) shell.complete_clear('foo', 'what ok yeah', 0, 1) shell.complete_ignore('foo', 'what ok yeah', 0, 1) shell.complete_remove('foo', 'what ok yeah', 0, 1) shell.complete_show('foo', 'what ok yeah', 0, 1) shell.complete_what('foo', 'what ok yeah', 0, 1) shell.do_where('foo') shell.do_collect('foo') shell.do_ignore('foo') shell.do_clear('foo') shell.do_remove('foo') shell.do_history('foo') shell.do_show('foo') shell.do_quit('foo') shell.do_playback('foo.txt') shell.precmd('foo') shell.close() answer = PoseidonShell.completion('what', 'foo what', ['what ok yeah']) assert answer == ['what ok yeah'] fields, sort_by, max_width, unique = shell._check_flags( { 'fields': ['foo'], 'sort_by': '1', 'max_width': '20' }, ['id']) assert unique == False assert fields == ['foo'] assert sort_by == 1 assert max_width == 20