diff options
| author | Ross Burton <ross.burton@arm.com> | 2025-06-20 16:14:21 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-06-23 21:42:54 +0100 |
| commit | 6091ebc9c5ebf0a2c900f75742d62b62ee7d5ade (patch) | |
| tree | 78dfe7b3a698789efef80b4391c811efc88fc0b4 /meta/lib/oeqa | |
| parent | 8e70eeb0b16be219a6f8a96e6f95c4904fd07131 (diff) | |
| download | poky-6091ebc9c5ebf0a2c900f75742d62b62ee7d5ade.tar.gz | |
oeqa/core/case: add file exists assertion
Add assertFileExists() to simply tests that want to check that a file
exists.
(From OE-Core rev: b62e53a0cff2522fef3b89de875c9526a626d7dd)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
| -rw-r--r-- | meta/lib/oeqa/core/case.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/meta/lib/oeqa/core/case.py b/meta/lib/oeqa/core/case.py index bc4446a938..ad5524a714 100644 --- a/meta/lib/oeqa/core/case.py +++ b/meta/lib/oeqa/core/case.py | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | # | 5 | # |
| 6 | 6 | ||
| 7 | import base64 | 7 | import base64 |
| 8 | import os | ||
| 8 | import zlib | 9 | import zlib |
| 9 | import unittest | 10 | import unittest |
| 10 | 11 | ||
| @@ -57,6 +58,13 @@ class OETestCase(unittest.TestCase): | |||
| 57 | d.tearDownDecorator() | 58 | d.tearDownDecorator() |
| 58 | self.tearDownMethod() | 59 | self.tearDownMethod() |
| 59 | 60 | ||
| 61 | def assertFileExists(self, filename, msg=None): | ||
| 62 | """ | ||
| 63 | Test that filename exists. If it does not, the test will fail. | ||
| 64 | """ | ||
| 65 | if not os.path.exists(filename): | ||
| 66 | self.fail(msg or "%s does not exist" % filename) | ||
| 67 | |||
| 60 | class OEPTestResultTestCase: | 68 | class OEPTestResultTestCase: |
| 61 | """ | 69 | """ |
| 62 | Mix-in class to provide functions to make interacting with extraresults for | 70 | Mix-in class to provide functions to make interacting with extraresults for |
