appcove/FileStruct — pull request #5 by mk-fg (2013-03-05 05:35:14+00:00)
Title: Tests batch1

Initial batch of tests for Client.
Put, Temp* and some other functionality isn't covered yet.

Shouldn't apply cleanly on top of some other requests, so if you'll merge these first, ping me and I'll rebase on top of them.

One other change here is a minor code restructure - FileStruct/__init__.py is used to import modules only.
That's consistent with how it's done in most distributed python modules and should allow to create submodules (e.g. s3_backend.py) and add import of these to __init__ in the same way (e.g. "from .s3_backend import S3Client").

I've initially wanted to split the local-fs ops from the API (as proposed before), but decided against it for three reasons:

* API is heavily oriented towards posix fs, with concepts like user, group and tempdir mixed in.
* In abscence of need for other backends it look like unnecessary work.
* WIth split API posix-fs backend would have to have similar tests, so it'd make sense to write these anyway.

One of the tests will fail without #4 (as it seem bogus not to allow these).

Tests are intended to be under "test" submodule (discoverable by existing tools), with files inside named after covered modules (e.g. test_core.py for core.py).
Can be run either via "python3 .../test/test_core.py", "python3 -m unittest discover", "nose" or whatever.

Next batch should probably cover the rest of the code, sometime later this week.