diff mbox series

[v3,03/32] tests/functional: resolve str(Asset) to cache file path

Message ID 20241217155953.3950506-4-berrange@redhat.com (mailing list archive)
State New
Headers show
Series tests/functional: various improvements wrt assets/scratch files | expand

Commit Message

Daniel P. Berrangé Dec. 17, 2024, 3:59 p.m. UTC
Allow an Asset object to be used in place of a filename but
making its string representation resolve to the cache file
path.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 tests/functional/qemu_test/asset.py | 3 +++
 1 file changed, 3 insertions(+)

Comments

Richard Henderson Dec. 17, 2024, 4:32 p.m. UTC | #1
On 12/17/24 09:59, Daniel P. Berrangé wrote:
> Allow an Asset object to be used in place of a filename but
> making its string representation resolve to the cache file
> path.
> 
> Signed-off-by: Daniel P. Berrangé<berrange@redhat.com>
> ---
>   tests/functional/qemu_test/asset.py | 3 +++
>   1 file changed, 3 insertions(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
diff mbox series

Patch

diff --git a/tests/functional/qemu_test/asset.py b/tests/functional/qemu_test/asset.py
index 559af0351f..c5d3e73c4b 100644
--- a/tests/functional/qemu_test/asset.py
+++ b/tests/functional/qemu_test/asset.py
@@ -39,6 +39,9 @@  def __repr__(self):
         return "Asset: url=%s hash=%s cache=%s" % (
             self.url, self.hash, self.cache_file)
 
+    def __str__(self):
+        return str(self.cache_file)
+
     def _check(self, cache_file):
         if self.hash is None:
             return True