assertEquals is deprecated in py3, replacing it.
Change-Id: Ida206abbb13c320095bb9e3b25a2b66cc31bfba8
Co-Authored-By: Ondřej Nový <ondrej.novy@firma.seznam.cz>
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
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
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
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