Index: pykota/trunk/tests/filldb.py
===================================================================
--- pykota/trunk/tests/filldb.py (revision 2682)
+++ pykota/trunk/tests/filldb.py (revision 2683)
@@ -11,16 +11,15 @@
 def createBillingCodes(number) :
     """Creates a number of billing codes."""
-    if number :
-        sys.stdout.write("Adding %i billing codes...\n" % number)
-        billingcodes = [ "test-billingcode-%05i" % i for i in range(number) ]
-        argsfile = open("arguments.list", "w")
-        argsfile.write('--add\n--reset\n--description\n"a billing code"\n')
-        for bname in billingcodes :
-            argsfile.write("%s\n" % bname)
-        argsfile.close()    
-        before = time.time()
-        os.system('pkbcodes --arguments arguments.list') 
-        after = time.time()
-        sys.stdout.write("\nTime elapsed : %.2f seconds\n\n" % (after - before))
+    sys.stdout.write("Adding %i billing codes...\n" % number)
+    billingcodes = [ "test-billingcode-%05i" % i for i in range(number) ]
+    argsfile = open("arguments.list", "w")
+    argsfile.write('--add\n--reset\n--description\n"a billing code"\n')
+    for bname in billingcodes :
+        argsfile.write("%s\n" % bname)
+    argsfile.close()    
+    before = time.time()
+    os.system('pkbcodes --arguments arguments.list') 
+    after = time.time()
+    sys.stdout.write("\nTime elapsed : %.2f seconds\n\n" % (after - before))
 
 def deleteBillingCodes() :
@@ -34,16 +33,15 @@
 def createPrinters(number) :
     """Creates a number of printers."""
-    if number :
-        sys.stdout.write("Adding %i printers...\n" % number)
-        printernames = [ "test-printer-%05i" % i for i in range(number) ]
-        argsfile = open("arguments.list", "w")
-        argsfile.write('--add\n--charge\n0.05\n--maxjobsize\n5\n--passthrough\n--description\n"a printer"\n')
-        for pname in printernames :
-            argsfile.write("%s\n" % pname)
-        argsfile.close()    
-        before = time.time()
-        os.system('pkprinters --arguments arguments.list') 
-        after = time.time()
-        sys.stdout.write("\nTime elapsed : %.2f seconds\n\n" % (after - before))
+    sys.stdout.write("Adding %i printers...\n" % number)
+    printernames = [ "test-printer-%05i" % i for i in range(number) ]
+    argsfile = open("arguments.list", "w")
+    argsfile.write('--add\n--charge\n0.05\n--maxjobsize\n5\n--passthrough\n--description\n"a printer"\n')
+    for pname in printernames :
+        argsfile.write("%s\n" % pname)
+    argsfile.close()    
+    before = time.time()
+    os.system('pkprinters --arguments arguments.list') 
+    after = time.time()
+    sys.stdout.write("\nTime elapsed : %.2f seconds\n\n" % (after - before))
 
 def deletePrinters() :
@@ -57,16 +55,15 @@
 def createUsers(number) :
     """Creates a number of users."""
-    if number :
-        sys.stdout.write("Adding %i users...\n" % number)
-        usernames = [ "test-user-%05i" % i for i in range(number) ]
-        argsfile = open("arguments.list", "w")
-        argsfile.write('--add\n--limitby\nbalance\n--balance\n50.0\n')
-        for uname in usernames :
-            argsfile.write("%s\n" % uname)
-        argsfile.close()    
-        before = time.time()
-        os.system('edpykota --arguments arguments.list') 
-        after = time.time()
-        sys.stdout.write("\nTime elapsed : %.2f seconds\n\n" % (after - before))
+    sys.stdout.write("Adding %i users...\n" % number)
+    usernames = [ "test-user-%05i" % i for i in range(number) ]
+    argsfile = open("arguments.list", "w")
+    argsfile.write('--add\n--limitby\nbalance\n--balance\n50.0\n')
+    for uname in usernames :
+        argsfile.write("%s\n" % uname)
+    argsfile.close()    
+    before = time.time()
+    os.system('edpykota --arguments arguments.list') 
+    after = time.time()
+    sys.stdout.write("\nTime elapsed : %.2f seconds\n\n" % (after - before))
 
 def deleteUsers() :
@@ -82,10 +79,19 @@
         sys.stderr.write("usage :  %s  NbBillingCodes  NbPrinters  NbUsers\n" % sys.argv[0])
     else :    
-        createBillingCodes(int(sys.argv[1]))
-        createPrinters(int(sys.argv[2]))
-        createUsers(int(sys.argv[3]))
-        deleteBillingCodes()
-        deleteUsers()           # NB : either this one or the one below
-        deletePrinters()        # also delete user print quota entries.
+        nbbillingcodes = int(sys.argv[1])
+        nbprinters = int(sys.argv[2])
+        nbusers = int(sys.argv[3])
+        if nbbillingcodes :
+            createBillingCodes(nbbillingcodes)
+        if nbprinters :
+            createPrinters(nbprinters)
+        if nbusers :    
+            createUsers(nbusers)
+        if nbbillingcodes :    
+            deleteBillingCodes()
+        if nbusers :    
+            deleteUsers()           # NB : either this one or the one below
+        if nbprinters :    
+            deletePrinters()        # also delete user print quota entries.
         os.remove("arguments.list")
         
