summaryrefslogtreecommitdiff
path: root/tests/test_multithreading.py
Commit message (Collapse)AuthorAgeFilesLines
* Add functional tests for python-swiftclientChristian Schwede2014-05-051-347/+0
| | | | | | | | | 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
* Fix test_multithreading on Python 3Victor Stinner2014-04-151-3/+9
| | | | | | | | | | | * On Python 3, the printer doesn't encode Unicode to utf8 anymore, since print() expects a Unicode string. * Update unit tests for Python 3 since repr() doesn't escape non-ASCII characters in Unicode strings anymore: http://legacy.python.org/dev/peps/pep-3138/ Change-Id: I89471019d691a46651312d6a49964b719192148a
* Use the standard library's copy of mock when it's available.Alex Gaynor2014-03-311-1/+6
| | | | Change-Id: Id6a31157582efe47cc3a74e6658679c2bec14767
* Python 3: Fix module names in importVictor Stinner2014-03-281-4/+4
| | | | | | Use six.moves to fix imports on Python 3. Change-Id: I35b9405690e9f0607b24d79aa7c00830df954c41
* Python 3: cast map() result to listVictor Stinner2014-03-241-3/+3
| | | | | | | | | | 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
* Replace xrange in for loop with rangeWu Wenxiang2014-01-141-10/+12
| | | | | | | | | xrange is not supported in python 3, so replace it with range since no large size lists involved. Closes-Bug: #1237717 Change-Id: I4e5e0782153d32c8beee03f7d871722ed4352859
* Move multi-threading code to a library.Darrell Bishop2013-07-281-0/+334
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