Tests work now with python 3 with the exception of the deletion of remote
testfolders which fails for some reasons.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
We don't want to hammmer IMAP servers for the test series too much
to avoid being locked out. We will need a few tests to test
concurrent connections, but by default one connection should be fine.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
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>
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>
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>
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>
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>
"python setup.py test" will now run the complete test suite. Remove the
previous ./test command.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
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>
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>