~saurabhanandiit/gtg/exportFixed

« back to all changes in this revision

Viewing changes to scripts/gtg_stress_test

Merge of my work on liblarch newbase and all the backends ported to liblarch
(which mainly means porting the datastore).
One failing test, will check it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
# -----------------------------------------------------------------------------
5
5
# Getting Things Gnome! - A personal organizer for the GNOME desktop
6
 
# Copyright (c) 2008,2009 Lionel Dricot & Bertrand Rousseau
 
6
# Copyright (c) 2008,2009,2010 Lionel Dricot & Bertrand Rousseau
7
7
#
8
8
# This program is free software: you can redistribute it and/or modify it under
9
9
# the terms of the GNU General Public License as published by the Free Software
27
27
import uuid
28
28
 
29
29
def connect():
30
 
    #We will connect on the session bus
 
30
    # We will connect on the session bus
31
31
    bus = dbus.SessionBus()
32
32
    liste = bus.list_names()
33
 
    busname = "org.GTG"
34
 
    remote_object = bus.get_object(busname,"/org/GTG")
35
 
    return dbus.Interface(remote_object,dbus_interface="org.GTG")
 
33
    busname = "org.gnome.GTG"
 
34
    remote_object = bus.get_object(busname,"/org/gnome/GTG")
 
35
    return dbus.Interface(remote_object,dbus_interface="org.gnome.GTG")
36
36
 
37
37
if __name__ == '__main__':
38
38
    if len(sys.argv) == 1:
39
 
         print "Usage: " + sys.argv[0] + " <number-of-tasks>"
 
39
         print "Usage: " + sys.argv[0] + " <number-of-tasks> [number-of-words-in-bodies]"
40
40
         sys.exit(1)
41
41
    total_tasks = int(sys.argv[1])
 
42
 
 
43
    text_length = 0
 
44
    if len(sys.argv) > 2:
 
45
        text_length = int(sys.argv[2])
 
46
 
42
47
    gtg = connect()
43
48
    for i in xrange(total_tasks):
44
 
        gtg.new_task("Active", str(uuid.uuid4()), "","","","","","")
 
49
        lengthy_text = ""
 
50
        for i in xrange(text_length):
 
51
            lengthy_text += str(uuid.uuid4())
 
52
        gtg.new_task("Active", str(uuid.uuid4()), '', '', '', [], lengthy_text, [])