Merge lp://qastaging/~james-w/desktopcouch/context-for-tests into lp://qastaging/desktopcouch
Proposed by
James Westby
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Approved by: | Nicola Larosa | ||||||||
Approved revision: | 122 | ||||||||
Merged at revision: | not available | ||||||||
Proposed branch: | lp://qastaging/~james-w/desktopcouch/context-for-tests | ||||||||
Merge into: | lp://qastaging/desktopcouch | ||||||||
Diff against target: |
134 lines (+54/-47) 1 file modified
desktopcouch/local_files.py (+54/-47) |
||||||||
To merge this branch: | bzr merge lp://qastaging/~james-w/desktopcouch/context-for-tests | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Nicola Larosa (community) | Approve | ||
Eric Casteleijn (community) | Approve | ||
Review via email:
|
Commit message
Add with_auth and with_keyring arguments to Context.
If with_auth is False then a couch started in the created context won't require or accept credentials. This makes it not really a desktopcouch, but the facilities for starting and stopping couchdb with a restricted configuration can be hugely useful to other projects to use in e.g. test suites.
If with_keyring is False then the credentials won't be read from or stored to gnome-keyring, so that if it is a non-default context (e.g. in a testsuite) it doesn't intefere with the user's desktopcouch, as gnome-keyring is the only global object that Context interacts with.
To post a comment you must log in.
Hi,
This implements fixes for a couple of bugs that I filed to
make it easier to use desktopcouch in testing other projects.
The first use-case is testing against a private desktopcouch
for projects that use it, without stomping on the information
stored in gnome-keyring.
After that I wanted to re-use desktopcouch's knowledge of stopping
and starting couchdb in a project where I wanted to use plain couch,
not a desktop one, so I added with_auth to just have it skip all
the credentials stuff and just start a couchdb in a private area
for testing.
There aren't any tests for it, for two reasons:
* The setup of a private context is done at import time, which
is then re-used. I could do a similar thing in a couple of tests
to change the arguments, but...
* The tests themselves are not isolated from gnome-keyring. Therefore
I wondered if they wanted to make use of the with_keyring argument,
though that would mean that codepath wasn't tested.
Therefore I would like some guidance on what the preferred testing
strategy would be for this.
Thanks,
James