sogo/Tests/Integration
Ludovic Marcotte 8698cb57c0 propagate from branch 'ca.inverse.sogo.1_3_1' (head d7190b0d224574c8656aa4031d63070f85201971)
to branch 'ca.inverse.sogo' (head 8604969aca9f512a5bfb3a1d79b03b7e261c4c4d)

Monotone-Parent: 8604969aca9f512a5bfb3a1d79b03b7e261c4c4d
Monotone-Parent: d7190b0d224574c8656aa4031d63070f85201971
Monotone-Revision: 61d77b3172c7a72376f9b867ab6d96136e763698

Monotone-Author: ludovic@Sophos.ca
Monotone-Date: 2010-08-19T19:31:41
Monotone-Branch: ca.inverse.sogo
2010-08-19 19:31:41 +00:00
..
all.py See ChangeLog 2010-08-03 15:13:58 +00:00
config.py.in Monotone-Parent: e9d4010d6c952c0aa503fa4571a589fb91c356b5 2010-07-13 17:36:32 +00:00
ev_generator.py Monotone-Parent: e9d4010d6c952c0aa503fa4571a589fb91c356b5 2010-07-13 17:36:32 +00:00
preferences.py See ChangeLog 2010-01-24 20:40:12 +00:00
propfind.py See ChangeLog 2010-01-24 20:40:12 +00:00
README Added migration script for Oracle Calendar. Updates the guides for the 1.3.1 release and the NEWS file. 2010-08-19 13:48:53 +00:00
sogotests.py Monotone-Parent: 16e84a4b9506eba9d39a96290c969eda838704a2 2010-07-13 16:02:56 +00:00
test-caldav-scheduling.py Updated the guides and a test case. 2010-08-12 18:04:27 +00:00
test-config.py Monotone-Parent: 16e84a4b9506eba9d39a96290c969eda838704a2 2010-07-13 16:02:56 +00:00
test-davacl.py Monotone-Parent: 4fcee5b7d94bbc45b4fc732c402cbfa7b3009735 2010-07-15 14:54:03 +00:00
test-ical.py Monotone-Parent: 16e84a4b9506eba9d39a96290c969eda838704a2 2010-07-13 16:02:56 +00:00
test-maildav.py Monotone-Parent: 16e84a4b9506eba9d39a96290c969eda838704a2 2010-07-13 16:02:56 +00:00
test-webdav.py Monotone-Parent: 16e84a4b9506eba9d39a96290c969eda838704a2 2010-07-13 16:02:56 +00:00
test-webdavlib.py Monotone-Parent: 16e84a4b9506eba9d39a96290c969eda838704a2 2010-07-13 16:02:56 +00:00
test-webdavsync.py Monotone-Parent: 16e84a4b9506eba9d39a96290c969eda838704a2 2010-07-13 16:02:56 +00:00
utilities.py Monotone-Parent: a79adaa6f36ea178ca12ab0e347e8def006787cc 2010-06-02 16:47:07 +00:00
webdavlib.py Monotone-Parent: 3774742a6943dc4914fba97472a150d427c3f883 2010-06-02 16:46:06 +00:00

setup
-----

(you need "python-simplejson", "python-xml", "python-vobject" 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) make sure that you use a fresh database, with no prior information in it
4) make sure that SOGoCalendarDefaultRoles and SOGoContactsDefaultRoles are empty or undefined
5) 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 contrarily to unit tests, functional tests
  often imply a logical order between the different steps.