This is an automated email from the git hooks/post-receive script.
nsoffer pushed a commit to branch master
in repository sanlock.
commit 99018463c965b95e11eec73eee027a2d451ad61d
Author: Amit Bawer <abawer(a)redhat.com>
AuthorDate: Thu May 16 13:52:24 2019 +0300
tests: Add util.generate_path for generating file paths by encoding
The path generation utility function will be used for testing API's
ability to handle the different encoded path strings/bytes in
upcoming changes related to path argument parsing and conversion.
---
tests/util.py | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/tests/util.py b/tests/util.py
index 86c6447..d944611 100644
--- a/tests/util.py
+++ b/tests/util.py
@@ -148,3 +148,15 @@ def check_rindex_entry(entry, name, offset=None, flags=None):
if flags is not None:
assert e_flags == flags
+
+
+def generate_path(dirname, filename, encoding=None):
+ """
+ Return path by joining dirname and filename.
+ The resulting path is either string if encoding is None,
+ or bytes encoded according to given encoding parameter.
+ """
+ path = os.path.join(str(dirname), filename)
+ if encoding:
+ path = path.encode(encoding)
+ return path
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date