diff mbox series

[4/6] tests.data: add test for builtin preferred over metadata value

Message ID 20230801143813.2206785-4-richard.purdie@linuxfoundation.org
State Accepted, archived
Commit e9150447738a48f772240874b3512b08e982b19b
Headers show
Series [1/6] tests.data: add test for inline python calling a def'd function | expand

Commit Message

Richard Purdie Aug. 1, 2023, 2:38 p.m. UTC
From: Christopher Larson <kergoth@gmail.com>

This test makes sure that '${@eval()}' calls the eval builtin, even if an 'eval' variable is defined in the metadata.

Signed-off-by: Christopher Larson <kergoth@gmail.com>
---
 lib/bb/tests/data.py | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/lib/bb/tests/data.py b/lib/bb/tests/data.py
index 251130b857..b7676859a6 100644
--- a/lib/bb/tests/data.py
+++ b/lib/bb/tests/data.py
@@ -86,6 +86,10 @@  class DataExpansions(unittest.TestCase):
         val = self.d.expand("${@testfunc(d)}")
         self.assertEqual(str(val), "testvalue")
 
+    def test_python_snippet_builtin_metadata(self):
+        self.d.setVar("eval", "INVALID")
+        self.d.expand("${@eval('3')}")
+
     def test_python_unexpanded(self):
         self.d.setVar("bar", "${unsetvar}")
         val = self.d.expand("${@d.getVar('foo') + ' ${bar}'}")