This is an automated email from the git hooks/post-receive script.
nsoffer pushed a commit to branch master
in repository sanlock.
commit b8a9a88d4ffa47214adc10bd52ac19ecc0a4e3fb
Author: Amit Bawer <abawer(a)redhat.com>
AuthorDate: Mon May 6 13:03:27 2019 +0300
tests: Test parsing a resource which is not a list of tuples
Expecting to get ValueError for resource argument which
is not a list of tuples (disk, offset).
Signed-off-by: Amit Bawer <abawer(a)redhat.com>
---
tests/python_test.py | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/tests/python_test.py b/tests/python_test.py
index d7ec0fb..28827d6 100644
--- a/tests/python_test.py
+++ b/tests/python_test.py
@@ -431,3 +431,18 @@ def test_write_resource_invalid_align_sector(
with pytest.raises(ValueError):
sanlock.write_resource(
"ls_name", "res_name", disks, align=align,
sector=sector)
+
+
+(a)pytest.mark.parametrize("resource", [
+ "invalid resource tuple",
+ b"invalid resource tuple",
+ u'\u05e9\u05dc\u05d5\u05dd',
+ b"\xd7\x90"
+])
+def test_write_resource_invalid_path(tmpdir, sanlock_daemon, resource):
+ # Test parsing a resource which is not a list of tuples
+ disks = [resource]
+ with pytest.raises(ValueError) as e:
+ sanlock.write_resource("ls_name", "res_name", disks)
+ assert repr(resource) in str(e.value)
+
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date