4 Commits

Author SHA1 Message Date
Joel Wright
bd42c2b00d This patch fixes downloading files to stdout.
This patch fixes downloading files to stdout and modifies
_SwiftReader to operate as an iterator that performs file
checks at the end of iteration as well as a context manager.
File verification checks have been removed from __exit__
and added to __iter__.

Change-Id: I3250bdeeef8484a9122c4b5b854756a7c8f8731e
Closes-Bug: 1395922
Closes-Bug: 1387376
2015-01-23 11:46:13 +00:00
Joel Wright
24673f8d19 Add importable SwiftService incorporating shell.py logic
This patch adds a SwiftService class that incorporates the high
level logic from swiftclient/shell.py. It also ports shell.py to
use the new class, and updates the code in swiftclient/multithreading.py
to allow the SwiftService to be used for multiple operations whilst
using only one thread pool.

Currently, code that imports swiftclient has to have its own logic for
things like creating large objects, parallel uploads, and parallel
downloads. This patch adds a SwiftService class that makes that
functionality available in Python code as well as through the shell.

Change-Id: I08c5796b4c01001d79fd571651c3017c16462ffd
Implements: blueprint bin-swift-logic-as-importable-library
2014-08-26 14:14:21 +02:00
Christian Schwede
876238a134 Remove testtools.main() call from tests
There is no testtools.main() at all (this was a
unittest.main() before). Let's remove this unused
and non-working code.

The following code can be used if someone needs
to start tests manually:

    python -m unittest <test_file.py>

Change-Id: Id5162ac73825584df6c23dbe68786ff3355fc6ae
2014-05-20 14:54:41 +00:00
Christian Schwede
eb94ac076d Add functional tests for python-swiftclient
Coverage for swiftclient.client is 71% with these tests.

Unit tests have been moved into another subdirectory
to separate them from functional tests.

Change-Id: Ib8c4d78f7169cee893f82906f6388a5b06c45602
2014-05-05 11:53:37 +02:00