[bitbake-devel] [PATCH] tests/data: Add a key deletion test

Richard Purdie richard.purdie at linuxfoundation.org
Tue Dec 23 12:33:48 UTC 2014


If you copy the datastore, then delete a key, it should not exist in
d.keys(). This adds a test to cover the recently found data store bug.

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

diff --git a/bitbake/lib/bb/tests/data.py b/bitbake/lib/bb/tests/data.py
index 9b09ff4..81e4091 100644
--- a/bitbake/lib/bb/tests/data.py
+++ b/bitbake/lib/bb/tests/data.py
@@ -121,6 +121,12 @@ class DataExpansions(unittest.TestCase):
         keys = self.d.keys()
         self.assertEqual(keys, ['value_of_foo', 'foo', 'bar'])
 
+    def test_keys_deletion(self):
+        newd = bb.data.createCopy(self.d)
+        newd.delVar("bar")
+        keys = newd.keys()
+        self.assertEqual(keys, ['value_of_foo', 'foo'])
+
 class TestNestedExpansions(unittest.TestCase):
     def setUp(self):
         self.d = bb.data.init()





More information about the bitbake-devel mailing list