Merge lp://qastaging/~thisfred/desktopcouch/fix_create_contacts into lp://qastaging/desktopcouch

Proposed by Eric Casteleijn
Status: Merged
Approved by: Tim Cole
Approved revision: 64
Merged at revision: not available
Proposed branch: lp://qastaging/~thisfred/desktopcouch/fix_create_contacts
Merge into: lp://qastaging/desktopcouch
Diff against target: None lines
To merge this branch: bzr merge lp://qastaging/~thisfred/desktopcouch/fix_create_contacts
Reviewer Review Type Date Requested Status
Nicola Larosa (community) Approve
Tim Cole (community) Approve
Stuart Langridge (community) Approve
Review via email: mp+11749@code.qastaging.launchpad.net

Commit message

Make create-contacts script agnostic of desktop vs cloud and oauth vs noauth.

To post a comment you must log in.
Revision history for this message
Eric Casteleijn (thisfred) wrote :

This allows the create contacts script to be agnostic of desktop vs cloud and oauth vs noauth.

Revision history for this message
Stuart Langridge (sil) wrote :

Looks good, all tests pass.

review: Approve
Revision history for this message
Tim Cole (tcole) wrote :

Excellent.

review: Approve
Revision history for this message
Nicola Larosa (teknico) wrote :

That's great, thanks for it.

review: Approve
65. By Eric Casteleijn

reenabled test

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'desktopcouch/contacts/testing/create.py'
2--- desktopcouch/contacts/testing/create.py 2009-09-09 23:24:53 +0000
3+++ desktopcouch/contacts/testing/create.py 2009-09-14 23:42:59 +0000
4@@ -21,7 +21,7 @@
5
6 import random, string, uuid
7
8-from couchdb import Server
9+from desktopcouch.records.server import OAuthCapableServer
10 import desktopcouch
11
12 CONTACT_DOCTYPE = 'http://www.freedesktop.org/wiki/Specifications/desktopcouch/contact'
13@@ -158,15 +158,15 @@
14 fielddict['application_annotations'] = app_annots
15 return fielddict
16
17-def create_many_contacts(
18- num_contacts=10, host='localhost', port=None,
19- db_name='contacts', doctype=CONTACT_DOCTYPE, app_annots=None):
20+def create_many_contacts(num_contacts=10, host='localhost', port=None,
21+ db_name='contacts', doctype=CONTACT_DOCTYPE,
22+ app_annots=None, server_class=OAuthCapableServer):
23 """Make many contacts and create their records"""
24 if port is None:
25 desktopcouch.find_pid()
26 port = desktopcouch.find_port()
27 server_url = 'http://%s:%s/' % (host, port)
28- server = Server(server_url)
29+ server = server_class(server_url)
30 db = server[db_name] if db_name in server else server.create(db_name)
31 record_ids = []
32 for maincount in range(1, num_contacts + 1):

Subscribers

People subscribed via source and target branches