#NEWLINE# @ patch ( 'sys.stdout' , new_callable = StringIO ) #NEWLINE# @ patch ( 'sys.stderr' , new_callable = StringIO ) #NEWLINE# def test_groups_users( stderr , stdout ) : #NEWLINE# #INDENT# tool = get_tool ( 'groups' ) #NEWLINE# server = Server ( 'localhost' ) #NEWLINE# with HTTMock ( list_groups_mock ) : #NEWLINE# #INDENT# status = tool . execute ( server , [ 'groups' , 'list' ] ) #NEWLINE# #UNINDENT# eq_ ( OK , tool ) #NEWLINE# eq_ ( EXPECTED_GROUPS , stdout . getvalue ( ) ) #NEWLINE# eq_ ( '' , stderr . getvalue ( ) )