sogo/Tests
Wolfgang Sourdeau 19f5d50e61 Monotone-Parent: 2ce99ebf3ed3c4ae56f0d8eab897684b58f759de
Monotone-Revision: 65d93d27a238a5e86f0c7bc9fd3cbc658d5ee681

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2009-08-06T21:41:19
Monotone-Branch: ca.inverse.sogo
2009-08-06 21:41:19 +00:00
..
all.py Monotone-Parent: 2ce99ebf3ed3c4ae56f0d8eab897684b58f759de 2009-08-06 21:41:19 +00:00
davacl.py Monotone-Parent: 97edd366e5777b4193d2520fb6aafb9633a5123d 2009-08-06 21:40:48 +00:00
propfind.py Monotone-Parent: 11e7712d6d915167dfc15be7f67ab23f7f9e7cc7 2009-08-05 15:34:45 +00:00
README Monotone-Parent: 2ce99ebf3ed3c4ae56f0d8eab897684b58f759de 2009-08-06 21:41:19 +00:00
testconfig.py.in Monotone-Parent: 97edd366e5777b4193d2520fb6aafb9633a5123d 2009-08-06 21:40:48 +00:00
webdavlib.py Monotone-Parent: f0967567767bc3e201a892b9a9fc17de9c47f0a1 2009-08-06 19:21:10 +00:00
webdavsync.py Monotone-Parent: 223a4ad09a33c8b2083c58b7e512c78200d305ec 2009-08-06 19:21:49 +00:00

setup
-----

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

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

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

all.py - run all scripts below at once
webdavsync.py
davacl.py

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 well written.
  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