#NEWLINE# def test_parse_result( self ) : #NEWLINE# #INDENT# args = shlex . split ( 'decanter -c setup.py -h example.com -p 8000 start' ) #NEWLINE# result = decanter . parse_args ( source = args ) #NEWLINE# self . assertEqual ( result . config , 'setup.py' ) #NEWLINE# self . assertEqual ( result . hostname , 'example.com' ) #NEWLINE# self . assertEqual ( result . port , 8000 ) #NEWLINE# self . assertEqual ( result . command , 'start' ) #NEWLINE# args = shlex . split ( 'decanter -c setup.py -h foo.bar -p 8080 stop' ) #NEWLINE# result = decanter . parse_args ( source = args ) #NEWLINE# self . assertEqual ( result . hostname , 'foo.bar' ) #NEWLINE# self . assertEqual ( result . port , 8080 ) #NEWLINE# self . assertEqual ( result . command , 'stop' ) #NEWLINE# args = shlex . split ( 'decanter status -p 8080 -h foo.bar -c setup.py' ) #NEWLINE# result = decanter . parse_args ( source = args ) #NEWLINE# self . assertEqual ( result . hostname , 'foo.bar' ) #NEWLINE# self . assertEqual ( result . port , 8080 ) #NEWLINE# self . assertEqual ( result . command , 'status' ) #NEWLINE# args = shlex . split ( 'decanter -c setup.py restart' ) #NEWLINE# result = decanter . parse_args ( source = args ) #NEWLINE# self . assertEqual ( result . hostname , 'localhost' ) #NEWLINE# self . assertEqual ( result . port , 9000 ) #NEWLINE# self . assertEqual ( result . command , 'restart' ) #NEWLINE# args = shlex . split ( 'decanter --config setup.py --hostname example.com --port 8000 start' ) #NEWLINE# result = decanter . parse_args ( source = args ) #NEWLINE# self . assertEqual ( result . config , 'setup.py' ) #NEWLINE# self . assertEqual ( result . hostname , 'example.com' ) #NEWLINE# self . assertEqual ( result . port , 8000 ) #NEWLINE# self . assertEqual ( result . command , 'start' ) #NEWLINE# args = shlex . split ( 'decanter --config setup.py --hostname foo.bar --port 8080 stop' ) #NEWLINE# result = decanter . parse_args ( source = args ) #NEWLINE# self . assertEqual ( self . hostname , 'foo.bar' ) #NEWLINE# self . assertEqual ( result . port , 8080 ) #NEWLINE# self . assertEqual ( result . command , 'stop' ) #NEWLINE# args = shlex . split ( 'decanter status --port 8080 --hostname foo.bar --config setup.py' ) #NEWLINE# result = decanter . parse_args ( source = args ) #NEWLINE# self . assertEqual ( result . hostname , 'foo.bar' ) #NEWLINE# self . assertEqual ( result . port , 8080 ) #NEWLINE# self . assertEqual ( result . command , 'status' ) #NEWLINE# args = shlex . split ( 'decanter --config setup.py restart' ) #NEWLINE# result = decanter . parse_args ( source = args ) #NEWLINE# self . assertEqual ( result . hostname , 'localhost' ) #NEWLINE# self . assertEqual ( result . port , 9000 ) #NEWLINE# self . assertEqual ( result . command , 'restart' ) #NEWLINE# args = shlex . split ( 'decanter -c setup.py --hostname example.com -p 8000 start' ) #NEWLINE# result = decanter . parse_args ( source = args ) #NEWLINE# self . assertEqual ( result . config , 'setup.py' ) #NEWLINE# self . assertEqual ( result . hostname , 'example.com' ) #NEWLINE# self . assertEqual ( result . port , 8000 ) #NEWLINE# self . assertEqual ( result . command , 'start' )