test/py: Rework how test_ums.py handles (not) having write enabled
authorTom Rini <trini@konsulko.com>
Wed, 12 Feb 2025 22:24:00 +0000 (16:24 -0600)
committerTom Rini <trini@konsulko.com>
Fri, 21 Feb 2025 14:24:02 +0000 (08:24 -0600)
commit203d3a9fc709571cfeacb93f1b027f6ecfcce173
treeed405cbdbc0894d2abcbb2c15650b5fc44cd3fe6
parent3e335ddca6fa7a3d613c082cf83ff7b5bd9ddc29
test/py: Rework how test_ums.py handles (not) having write enabled

With a newer pylint version we get a warning about how mounted_test_fn
could be used before assignment. Evaluating the code, this can't happen
because we check for "not have_writable_fs_partition" and return before
moving to the part of the tests which use mounted_test_fn. However, we
should instead have this written so that we only try this part of the
test if have_writable_fs_partition is set, and this also fixes the
warning. As part of this we also move test_f and mounted_test_fn to the
section of code that already only does this if
have_writable_fs_partition is set.

Signed-off-by: Tom Rini <trini@konsulko.com>
test/py/tests/test_ums.py