Branch: refs/heads/master
Home: https://github.com/openSUSE/osc2
Commit: 1abbacd6f9605aafcf82aee5ef194d2a15c82fec
https://github.com/openSUSE/osc2/commit/1abbacd6f9605aafcf82aee5ef194d2a15c8...
Author: Marcus Huewe
Date: 2014-12-18 (Thu, 18 Dec 2014)
Changed paths:
A test/util/test_delegation.py
Log Message:
-----------
- test.util.test_delegation: initial testcases for the osc2.util.delegation module
Commit: bb47ef63c6e60e1c0a74378d06e7285a5a0a7f82
https://github.com/openSUSE/osc2/commit/bb47ef63c6e60e1c0a74378d06e7285a5a0a...
Author: Marcus Huewe
Date: 2014-12-18 (Thu, 18 Dec 2014)
Changed paths:
M test/suite.py
Log Message:
-----------
- test.suite: added test.util.test_delegation module to the testsuite
Commit: 23a3f8cac047d0bb549c95d0550e0bf50cb19ae2
https://github.com/openSUSE/osc2/commit/23a3f8cac047d0bb549c95d0550e0bf50cb1...
Author: Marcus Huewe
Date: 2014-12-18 (Thu, 18 Dec 2014)
Changed paths:
A osc2/util/delegation.py
Log Message:
-----------
- util.delegation: added initial delegation module
It provides classes that facilitate delegation tasks.
These classes can be used, if normal duck typing is not sufficient
anymore. Suppose an instance of the class osc2.util.io.TemporaryDirectory
should be passed to the os.stat function. This will not work, because os.stat
requires a str/unicode or buffer instance as a parameter. Thus, simple
duck typing is insufficient (PyUnicode_FromEncodedObject, which is
indirectly called by posix_do_stat, has "strict" type checks).
So the idea is to wrap the TemporaryDirectory instance in an instance that
behaves like/is a str/unicode instance. Additionally, all non-str method
calls are delegated to the real TemporaryDirectory instance.
For this, this module provides several classes.
The use-case from above is implemented in the osc2.util.io.mkdtemp function.
Compare: https://github.com/openSUSE/osc2/compare/b6d0f29ad83d...23a3f8cac047