Created
May 14, 2014 13:39
-
-
Save dreispt/ba5d0067368fdb095beb to your computer and use it in GitHub Desktop.
Create 1000 Project Issue for load testing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xmlrpclib | |
host, port, db = "localhost", 8069, "demo" | |
user, pwd = "demo", "demo" | |
url = "http://%s:%d/xmlrpc/common" % (host, port) | |
sock = xmlrpclib.ServerProxy(url) | |
uid = sock.login(db, user, pwd) | |
url = "http://%s:%d/xmlrpc/object" % (host, port) | |
sock = xmlrpclib.ServerProxy(url) | |
for i in range(1000): | |
print i, | |
doc = {'name': 'Issue #%d' % i, 'project_id': 1} | |
doc_id = sock.execute(db, uid, pwd, 'project.issue', 'create', doc) | |
print "->", doc_id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment