sogo/Tests
Wolfgang Sourdeau ecfd8f026e Monotone-Parent: 14fb6c252ef1563d917c59f289ac3d06479a7eab
Monotone-Revision: d085b8d79d3eca94ece4f311bf3d652d7f20bb00

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2009-08-10T20:59:49
Monotone-Branch: ca.inverse.sogo
2009-08-10 20:59:49 +00:00
..
README Monotone-Parent: 4c99eaa0c282b891ef5c1826c947d6ac58af26c7 2009-08-07 17:52:53 +00:00
all.py Monotone-Parent: 6eb182232c54958d95899ac372dfe954dcc1b9f4 2009-08-07 15:55:15 +00:00
config.py.in Monotone-Parent: 65d93d27a238a5e86f0c7bc9fd3cbc658d5ee681 2009-08-07 15:40:03 +00:00
propfind.py Monotone-Parent: 6d46b1f98d1e4729c6c951fd4d0ce045cda38d4f 2009-08-10 16:25:40 +00:00
test-davacl.py Monotone-Parent: 14fb6c252ef1563d917c59f289ac3d06479a7eab 2009-08-10 20:59:49 +00:00
test-wedavsync.py Monotone-Parent: 65d93d27a238a5e86f0c7bc9fd3cbc658d5ee681 2009-08-07 15:40:03 +00:00
webdavlib.py Monotone-Parent: 35e9c147975a505b9f65362ed057555a3cd24c9b 2009-08-10 15:13:45 +00:00

README

setup
-----

(you need "python-xml" and "python-m2crypto" in order to run the scripts on Debian)

1) copy config.py.in to config.py (make sure to never EVER add it to monotone)
2) edit config.py to suit your environment
3) run the test scripts

runnable scripts
----------------

all.py - run all scripts below at once
test-webdavsync.py - explicit
test-davacl.py - dav acl tests for calendar and addressbook modules

other scripts
-------------

propfind.py - a sample implementation of a PROPFIND request using webdavlib

* developers
------------

- Test methods are always prefixed with "test". Sometimes, it's easier to
track down a problem by enabling only one test at a time. One possible method
is to replace "def test" with "def xtest" and replace it back when the
problems are solved.

- Test failures start with "FAIL:". Those are the ones that indicate possible
  bugs in the application, if the test is itself known to work.
  For example like this:

======================================================================
FAIL: 'modify' PUBLIC, 'view all' PRIVATE, 'view d&t' confidential
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./davacl.py", line 75, in testModifyPublicViewAllPrivateViewDConfidential
    self._testRights({ "pu": "m", "pr": "v", "co": "d" })
  File "./davacl.py", line 119, in _testRights
    self._testCreate(rights)
  File "./davacl.py", line 165, in _testCreate
    exp_code)
  File "./davacl.py", line 107, in _putEvent
    % (exp_status, put.response["status"]))
AssertionError: event creation/modification: expected status code '403' (received '201')

- Test errors start with "ERRORS" and most likely indicate a bug in the test
  code itself.

- Always set a doc string on the test methods, especially for complex test
  cases.

- When writing tests, be aware that contrary to unit tests, functional tests
  often imply a logical order between the different steps.