summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bb/tests/data.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/data.py b/bitbake/lib/bb/tests/data.py
index b4e90e0327..e285c223dc 100644
--- a/bitbake/lib/bb/tests/data.py
+++ b/bitbake/lib/bb/tests/data.py
@@ -325,6 +325,20 @@ class TestOverrides(unittest.TestCase):
325 bb.data.update_data(self.d) 325 bb.data.update_data(self.d)
326 self.assertEqual(self.d.getVar("TEST", True), "testvalue3") 326 self.assertEqual(self.d.getVar("TEST", True), "testvalue3")
327 327
328class TestKeyExpansion(unittest.TestCase):
329 def setUp(self):
330 self.d = bb.data.init()
331 self.d.setVar("FOO", "foo")
332 self.d.setVar("BAR", "foo")
333
334 def test_keyexpand(self):
335 self.d.setVar("VAL_${FOO}", "A")
336 self.d.setVar("VAL_${BAR}", "B")
337 with LogRecord() as logs:
338 bb.data.expandKeys(self.d)
339 self.assertTrue(logContains("Variable key VAL_${FOO} (A) replaces original key VAL_foo (B)", logs))
340 self.assertEqual(self.d.getVar("VAL_foo", True), "A")
341
328class TestFlags(unittest.TestCase): 342class TestFlags(unittest.TestCase):
329 def setUp(self): 343 def setUp(self):
330 self.d = bb.data.init() 344 self.d = bb.data.init()