5 Commits

Author SHA1 Message Date
janonymous
f5f9d791b0 pep8 fix: assertEquals -> assertEqual
assertEquals is deprecated in py3, replacing it.

Change-Id: Ida206abbb13c320095bb9e3b25a2b66cc31bfba8
Co-Authored-By: Ondřej Nový <ondrej.novy@firma.seznam.cz>
2015-10-11 12:57:25 +02:00
janonymous
cd7b2db550 unit tests: Replace "self.assert_" by "self.assertTrue"
The assert_() method is deprecated and can be safely replaced by assertTrue().
This patch makes sure that running the tests does not create undesired
warnings.

Change-Id: I0602ba39ef93263386644ee68088d5f65fcb4a71
2015-07-21 19:23:00 +05:30
Clay Gerrard
92fd28aa6a Fix a few edges where we lost python 2.6 support
a.k.a. put my head in the sand about the reality of not supporting python 2.6
a little while longer.  We need to get something in the next release notes
about deprecating support for python 2.6 ASAP.  I don't really care enough
about it to keep cleaning up the junk we're going to let slip through not
testing python 2.6 in the gate.

Change-Id: Ib36cd66bda29d75d3b5f4ef0a0ef7b824923df28
2015-01-08 18:22:40 -08:00
Nicolas Trangez
bf4c78bc25 Add tests for unavailability of tee and splice in libc
As suggested by Paul Luse in review 135319 (for 2a0a8ae00f2), this
brings test coverage of the `swift.common.splice` module up to 100%.

The mechanism used to check whether the functions are looked up on `libc`
is somewhat ugly, but using a `PropertyMock` raising an `AttributeError`
as `side_effect` doesn't work: it results in `mock` creating a `Mock`
instance and returning it.

Change-Id: I14828cfc2ae644dbd9ead8c20613b19cea8607f1
See: https://review.openstack.org/#/c/135319/4/swift/common/splice.py,cm
See: 2a0a8ae00f2d3b7db255b0905b063e930f824f3d
2014-12-21 15:24:02 +01:00
Nicolas Trangez
2a0a8ae00f Rework splice and tee
This patch reworks the bindings to `splice` and `tee` in order to fix a
(potential) bug when using the old `splice` binding and passing offsets
(see https://review.openstack.org/#/c/135319/ for a discussion of the
issue).

The new binding code (based on https://github.com/NicolasT/tee-n-splice)
uses more `ctypes` features w.r.t. parameter and return value handling.

It also introduces a test suite for both calls.

Change-Id: Ib8084ca20fe7a199a00067da9386c2ccf618755c
2014-11-20 02:30:51 +01:00