1
0
mirror of https://github.com/OfflineIMAP/offlineimap.git synced 2024-07-03 08:30:56 +02:00
Commit Graph

12 Commits

Author SHA1 Message Date
Sebastian Spaeth
5979cc8ff9 tests: Add MappedIMAP test skeleton
No working tests yet.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-02-17 10:26:43 +01:00
Sebastian Spaeth
79ddb0be71 tests: add delete remote folder helper function
We need to clean out the remote folders before we invoke the test suite.
Implement a helper function that does this, and improve the test output
(less verbose) and the setup.py --help-commands (more verbose). Document
that it is possible to run a single test only. (although it is not
guaranteed that a test does not rely on the output of previous tests).

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-02-17 10:12:53 +01:00
Sebastian Spaeth
ac033c68fd Improve nametrans local->remote folder syncing
While improving the test suite, I noticed that we would not create folders on
the remote in some cases when we should (yay for test suites!). This is because
we were testing the untransposed LOCAL foldername and check if it existed on
the remote side when deciding whether we should potentially create a new folder.

Simplify the code by transposing the LOCAL folder names in dst_hash, saving us
to create another confusing "newsrc" temp variable. Make the code a bit more
readable by using dst_name_t to indicate we operate a transposed folder name.

This now passes test 03 (using invalid nametrans rules) when test 03 would pass
before.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-02-16 11:45:18 +01:00
Sebastian Spaeth
75ea403278 test: Split configuration generation so we can tweak values
Use get_default_config and write_config_file (which can be handed an optional
config object), so we can manipulate configuration options easily from within
the test function.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-02-16 09:58:59 +01:00
Sebastian Spaeth
c1f75a6c94 test: Create all intermediary maildirs
Don't fail if root maildir folder does not exist it. Create it recursively.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-02-16 09:56:23 +01:00
Sebastian Spaeth
314a4e3b2c Improve test suite and add test
1) Add helper functions to create and count maildirs and mails.

2) Add a second test that creates 2 maildirs, one of the including a
quotation sign " in its folder name and sync.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-20 15:55:44 +01:00
Sebastian Spaeth
2776ee1974 Create temp directories in "test" dir
Don't create the temp dirs in the current directory, but create them in
the same directory as the credentials.conf file is. We still need to
prevent deleting them on test failure, so that they can be inspected
manually.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-19 10:32:05 +01:00
Sebastian Spaeth
bf1f79c571 Add "test" command to setup.py
"python setup.py test" will now run the complete test suite. Remove the
previous ./test command.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-19 10:32:05 +01:00
Sebastian Spaeth
1f91d0fd06 Adapt imports so that test/OLItest can be imported
To run the test suite from the main setup.py we need to be able to
import and run the test suite from a different folder than the "test"
dir.

Make "test" a package and fix the imports to still work when imported
from another folder.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-19 10:32:05 +01:00
Sebastian Spaeth
1cdabcec46 Add code comment
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-19 10:32:05 +01:00
Sebastian Spaeth
9a905188f2 Add userfriendly warning if credentials.conf is missing
Warn the user and advise what she should be doing to get going.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-19 10:32:05 +01:00
Sebastian Spaeth
7b75e04b5b Add initial skeleton for a testing framework
This is the first revision that actually performs a test, in that it
starts up OfflineImap and sees if there are any exceptions.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-01-19 10:32:05 +01:00