[Pkg-linaro-lava-devel] Bug#1102293: lavacli: Fix test_base_dir to handle paths containing dots correctly
Yang, Lei
Lei.Yang at windriver.com
Mon Apr 7 12:39:52 BST 2025
Package: lavacli
Version: 2.2.0-2
Severity: normal
Tags: patch
Dear Maintainer,
I'd like to submit a patch for the lavacli package that fixes a failing test in test_lab.py where paths containing dots aren't handled correctly. See the failure in https://ci.debian.net/packages/l/lavacli/unstable/amd64/
The test_base_dir test is currently comparing paths incorrectly:
assert str(config.base_dir) == str(config.filepath).split(".")[0]
This fails when the temporary test path contains dots (e.g. "/tmp/autopkgtest.xVit3Q/...") because split(".") only removes text after the first dot.
My patch modifies the assertion to use Path.with_suffix('') instead:
assert str(config.base_dir) == str(config.filepath.with_suffix(''))
This correctly compares the base directory with the filepath without its extension, regardless of how many dots appear in the path.
Thank you for considering this patch attached
Lei
More information about the Pkg-linaro-lava-devel
mailing list