<s> import pytest <EOL> import decorators <EOL> @ pytest . mark . parametrize ( "<STR_LIT>" , [ <EOL> ( '<STR_LIT:foo>' , [ '<STR_LIT:foo>' ] ) , <EOL> ( [ '<STR_LIT:foo>' ] , [ '<STR_LIT:foo>' ] ) , <EOL> ( [ '<STR_LIT:foo>' , '<STR_LIT:bar>' ] , [ '<STR_LIT:foo>' , '<STR_LIT:bar>' ] ) , <EOL> ] ) <EOL> def test_command ( input , expected ) : <EOL> @ decorators . command ( input ) <EOL> def foo ( ) : <EOL> pass <EOL> assert foo . commands == expected <EOL> def test_command_overwrites ( ) : <EOL> @ decorators . command ( '<STR_LIT:foo>' ) <EOL> @ decorators . command ( '<STR_LIT:bar>' ) <EOL> def foo ( ) : <EOL> pass <EOL> assert foo . commands == [ '<STR_LIT:foo>' ] <EOL> def test_command_function_wrap ( ) : <EOL> @ decorators . command ( '<STR_LIT:foo>' ) <EOL> def foo ( bar , baz ) : <EOL> return bar + baz <EOL> assert foo ( <NUM_LIT:3> , baz = <NUM_LIT:4> ) == <NUM_LIT:7> <EOL> assert foo ( <NUM_LIT:5> , <NUM_LIT:5> ) == <NUM_LIT:10> <EOL> @ pytest . mark . parametrize ( "<STR_LIT:value>" , [ <EOL> True , <EOL> False , <EOL> <NUM_LIT:5> , <EOL> <NUM_LIT> , <EOL> ( '<STR_LIT:foo>' , ) , <EOL> { '<STR_LIT:foo>' : '<STR_LIT:bar>' } , <EOL> object ( ) , <EOL> ] ) <EOL> def test_command_exceptions ( value ) : <EOL> with pytest . raises ( TypeError ) : <EOL> @ decorators . command ( value ) <EOL> def foo ( ) : <EOL> pass <EOL> def test_help ( ) : <EOL> @ decorators . help ( "<STR_LIT>" ) <EOL> def foo ( ) : <EOL> pass <EOL> assert foo . help == [ "<STR_LIT>" ] <EOL> def test_help_order ( ) : <EOL> @ decorators . help ( "<STR_LIT>" ) <EOL> @ decorators . help ( "<STR_LIT>" ) <EOL> def foo ( ) : <EOL> pass <EOL> assert foo . help == [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> ] <EOL> def test_help_function_wrap ( ) : <EOL> @ decorators . help ( '<STR_LIT:foo>' ) <EOL> def foo ( bar , baz ) : <EOL> return bar + baz <EOL> assert foo ( <NUM_LIT:3> , baz = <NUM_LIT:4> ) == <NUM_LIT:7> <EOL> assert foo ( <NUM_LIT:5> , <NUM_LIT:5> ) == <NUM_LIT:10> <EOL> @ pytest . mark . parametrize ( "<STR_LIT:value>" , [ <EOL> True , <EOL> False , <EOL> <NUM_LIT:5> , <EOL> <NUM_LIT> , <EOL> ( '<STR_LIT:foo>' , ) , <EOL> [ "<STR_LIT>" ] , <EOL> { '<STR_LIT:foo>' : '<STR_LIT:bar>' } , <EOL> object ( ) , <EOL> ] ) <EOL> def test_help_exceptions ( value ) : <EOL> with pytest . raises ( TypeError ) : <EOL> @ decorators . help ( value ) <EOL> def foo ( ) : <EOL> pass <EOL> @ pytest . mark . parametrize ( "<STR_LIT>" , [ <EOL> ( '<STR_LIT>' , [ '<STR_LIT>' ] ) , <EOL> ( [ '<STR_LIT>' ] , [ '<STR_LIT>' ] ) , <EOL> ( [ '<STR_LIT>' , '<STR_LIT>' ] , [ '<STR_LIT>' , '<STR_LIT>' ] ) , <EOL> ] ) <EOL> def test_event ( input , expected ) : <EOL> @ decorators . event ( input ) <EOL> def eventCallback ( ) : <EOL> pass <EOL> assert eventCallback . events == expected <EOL> def test_event_overwrites ( ) : <EOL> @ decorators . event ( '<STR_LIT>' ) <EOL> @ decorators . event ( '<STR_LIT>' ) <EOL> def foo ( ) : <EOL> pass <EOL> assert foo . events == [ '<STR_LIT>' ] <EOL> def test_event_function_wrap ( ) : <EOL> @ decorators . event ( '<STR_LIT:foo>' ) <EOL> def foo ( bar , baz ) : <EOL> return bar + baz <EOL> assert foo ( <NUM_LIT:3> , baz = <NUM_LIT:4> ) == <NUM_LIT:7> <EOL> assert foo ( <NUM_LIT:5> , <NUM_LIT:5> ) == <NUM_LIT:10> <EOL> @ pytest . mark . parametrize ( "<STR_LIT:value>" , [ <EOL> True , <EOL> False , <EOL> <NUM_LIT:5> , <EOL> <NUM_LIT> , <EOL> ( '<STR_LIT:foo>' , ) , <EOL> { '<STR_LIT:foo>' : '<STR_LIT:bar>' } , <EOL> object ( ) , <EOL> ] ) <EOL> def test_event_exceptions ( value ) : <EOL> with pytest . raises ( TypeError ) : <EOL> @ decorators . event ( value ) <EOL> def foo ( ) : <EOL> pass </s>
