5 Commits

Author SHA1 Message Date
Alex Gaynor
4e7bc75432 Use the standard library's copy of mock when it's available.
Change-Id: Id6a31157582efe47cc3a74e6658679c2bec14767
2014-03-31 11:34:49 -07:00
Victor Stinner
e3b7ecd2bb Python 3: Fix module names in import
Use six.moves to fix imports on Python 3.

Change-Id: I35b9405690e9f0607b24d79aa7c00830df954c41
2014-03-28 15:04:14 +00:00
Victor Stinner
6d5a4749b5 Python 3: cast map() result to list
On Python 3, map() returns a generator, not a list. Cast explicitly the result
of map() to a list to get a list on Python 2 and Python 3.

The cast is useless in Python 2, but it doesn't hurt performances: it's just a
unit test.

Change-Id: I87486b7dbc42507a6fd7886748a2e09735b6fc5b
2014-03-24 18:17:44 +01:00
Wu Wenxiang
a1cf366a0b Replace xrange in for loop with range
xrange is not supported in python 3, so replace it with range since no
large size lists involved.

Closes-Bug: #1237717

Change-Id: I4e5e0782153d32c8beee03f7d871722ed4352859
2014-01-14 21:49:44 +08:00
Darrell Bishop
9198e95468 Move multi-threading code to a library.
This patch extracts the multi-threading code from bin/swift into
swiftclient/multithreading and adds tests.  In particular, this new way
of doing it (with context managers) will prevent non-daemonic threads
from wedging the process when unexpected exceptions happen.

I enabled reporting of which lines, specifically, are not covered by
unit tests (added -m option to "coverage report" in .unittests).

This patch includes a drive-by fix for uploading a segmented file with
--use-slo when that object already exists.  A key of "name" was used
instead of "path", raising KeyError.

There's also another drive-by fix for uploading segmented objects with
--use-slo.  Commit 874e0e4427b80e1b15b74a1557b73ba9d61443ca regressed
this by removing the capturing of thread-worker results in
QueueFunctionThread.run().  This patch restores that functionality and
the feature (uploading SLO objects).

Change-Id: I0b4f677e4a734e83d1a25088d9a74f7d46384e53
2013-07-28 22:08:17 -07:00