Commits

Ronny Pfannschmidt  committed fbc470c

readme

  • Participants
  • Parent commits 790f6f2
  • Tags v0.3

Comments (0)

Files changed (4)

 pytest-couchdbkit
 =================
 
-:name: pytest-couchdbkit
-:description: test
+pytest-couchdbkit is a simple pytest extension that manages test databases
+for your couchdbkit using apps.
 
+In order to use it, you only need to set the ini option
+`couchdbkit_suffix` to something fitting your app.
+Additionally you may use `couchdbkit_backend` to select
+the gevent/eventlet backends.
+
+
+
+The provided funcarg `couchdb` will be a freshly flushed database
+named `pytest_` + couchdbkit_suffix,
+additionally, after each test item,
+the database will be dumped to tmpdir.join(couchdb.dump)
+
+which is a simple file having entries in the format::
+
+    number(\d+) + "\r\n" + number bytes + "\r\n"
+
+entries are:
+
+* the db info
+* documents
+* raw attachment data following the document
+
+Attachments are ordered by name,
+so they can be reassigned to their metadata on loading.
+
+The dump format is meant to be human-readable.
+
+
+
+Future
+------
+
+* fs fixtures (like couchapp)
+* code fixtures
+* dump fixtures
+* comaring a db to sets of defined fixtures
+
+CHANGELOG
+=========
 
 from 0.2 to 0.3
 ---------------
+
 - switch dump format to chunked encoding
 - pretty json in dumps
 - attachments in dumps
-- utilities for loading dumps back to a database
+- utility functions for loading dumps back to a database
 
 
 from 0.1 to 0.2

File pytest_couchdbkit/__init__.py

             dump_db(db, fp)
     request.addfinalizer(finalize_db)
     return db
-    
+
     get_version_from_hg=True,
 
     description='py.test extension for per-test couchdb databases using couchdbkit',
-    long_description=open("CHANGELOG").read(),
+    long_description=open("README").read(),
 
     author='RonnyPfannschmidt',
     author_email='ronny.pfannschmidt@gmx.de',

File testing/test_dumper.py

 
     doc = {'_id': 'test'}
     couchdb.save_doc(doc)
-    
+
     first = list(items(couchdb))
     assert len(first) == 1
     assert first[0] == doc