~ubuntu-branches/ubuntu/trusty/desktopcouch/trusty

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Chad MILLER
  • Date: 2010-06-22 16:21:19 UTC
  • Revision ID: james.westby@ubuntu.com-20100622162119-3ebuc61x323kahha
Tags: 0.6.6-0ubuntu1
* New upstream release, 0.6.6. (There is no 0.6.5, except in the wild.)
* Resolve circular dependencies.  Group together dependent code in 
  'desktopcouch' package, and make transition packages of subpackages.
  Upstream will try decoupling properly in future.  (Debian: #571929)
* debian/patches/lp_522538.patch
  - No longer needed.  Removed.
* debian/patches/replication-exclusion.patch
  - No longer needed.  Removed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
346
346
        constructed_record.attach(content, "nu/mbe/rs", "text/plain")
347
347
        constructed_record.attach("string", "another document", "text/plain")
348
348
 
 
349
        constructed_record.attach("XXXXXXXXX", "never used", "text/plain")
 
350
        constructed_record.detach("never used")  # detach works before commit.
 
351
 
349
352
        # We can read from a document that we constructed.
350
353
        out_file, out_content_type = \
351
354
                constructed_record.attachment_data("nu/mbe/rs")
365
368
        # get new
366
369
        retrieved_record = self.database.get_record(record_id)
367
370
 
368
 
        # To replace, one must remove first.
 
371
        # Remove and test that it is indeed gone.
369
372
        retrieved_record.detach("another document")
 
373
        self.assertRaises(KeyError, retrieved_record.detach,
 
374
                "another document")
 
375
 
 
376
        # push new version
 
377
        record_id = self.database.put_record(retrieved_record)
 
378
        # get new
 
379
        retrieved_record = self.database.get_record(record_id)
 
380
 
 
381
        # We can get a list of attachments.
 
382
        self.assertEqual(set(retrieved_record.list_attachments()),
 
383
                set(["nu/mbe/rs", "Document"]))
 
384
 
 
385
        # Send back name.
370
386
        retrieved_record.attach(content, "another document", "text/plain")
371
387
 
372
388
        # push new version