#NEWLINE# def user_mkdir( cmd , **kwargs ) : #NEWLINE# #INDENT# '\n    Used in system tests to emulte a user creating a directory\n    ' #NEWLINE# if ( type ( cmd ) is str ) : #NEWLINE# #INDENT# assert ( cmd is not '' ) , 'no arguments passed to mkdir, not allowed' #NEWLINE# cmd = cmd . split ( ) #NEWLINE# #UNINDENT# if ( len ( cmd ) == 2 ) : #NEWLINE# #INDENT# assert ( '-p' in cmd ) , "two args to mkdir, neither is '-p', not allowed" #NEWLINE# cmd . remove ( '-p' ) #NEWLINE# mkdir_cmd = os . makedirs #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# mkdir_cmd = os . mkdir #NEWLINE# #UNINDENT# new_dir = cmd [ 0 ] #NEWLINE# assert ( not os . path . exists ( new_dir ) ) , ( ( "directory '" + new_dir ) + "' already exists" ) #NEWLINE# mkdir_cmd ( new_dir ) #NEWLINE# return 0