~ubuntu-branches/ubuntu/lucid/desktopcouch/lucid-201101211957

« back to all changes in this revision

Viewing changes to desktopcouch/records/tests/test_server.py

  • Committer: Bazaar Package Importer
  • Author(s): Chad Miller, Ken VanDine, Chad Miller
  • Date: 2009-09-01 11:57:25 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090901115725-memhukcaj0ffewo2
Tags: 0.3.1-0ubuntu1
[Ken VanDine]
* debian/control
  - Added depends on python-desktopcouch-records. (LP: #422179)
[Chad Miller]
* New upstream release.
* Changed Vcs-Bzr links in control file.
* Changed version dependency on couchdb.
* Converting to a full-blown source-package branch.
* Fix getPort failure. (LP: #420911, LP: #422127)
* Check couchdb bind-port in replicator. (LP: #419973)
* Change couchdb bind-port in pairing tool. (LP: #419969)

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
"""testing database/contact.py module"""
20
20
import testtools
21
 
from desktopcouch.records.server import CouchDatabase
 
21
from desktopcouch.records.server import CouchDatabase, row_is_deleted
22
22
from desktopcouch.records.record import Record
23
23
from desktopcouch.records.tests import get_uri
24
24
 
146
146
        other_record_type = "http://example.com/unittest/bad"
147
147
 
148
148
        for i in range(7):
 
149
            record = Record({'record_number': i},
 
150
                    record_type=good_record_type)
149
151
            if i % 3 == 1:
150
152
                record = Record({'record_number': i},
151
153
                        record_type=good_record_type)
152
154
                record_ids_we_care_about.add(self.database.put_record(record))
 
155
            elif i % 3 == 2:
 
156
                record = Record({'record_number': i},
 
157
                        record_type=good_record_type)
 
158
                record_id = self.database.put_record(record)  # correct type,
 
159
                self.database.delete_record(record_id)  # but marked deleted!
153
160
            else:
154
161
                record = Record({'record_number': i},
155
162
                        record_type=other_record_type)
160
167
        for row in results[good_record_type]:  # index notation
161
168
            self.assertTrue(row.id in record_ids_we_care_about)
162
169
            record_ids_we_care_about.remove(row.id)
 
170
            self.assertFalse(row_is_deleted(row))
163
171
 
164
172
        self.assertTrue(len(record_ids_we_care_about) == 0, "expected zero")
165
173