summaryrefslogtreecommitdiffstats
path: root/lib/bb/tests/data.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2014-12-23 12:33:48 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-12-23 12:34:53 +0000
commit16d5f40ad20fd08bf7a4d0e36200c739b5a9f59e (patch)
tree3a04e3237a61bd41de8c73151026605d1164bb1d /lib/bb/tests/data.py
parent6c046660cfc4fb3792a42aeafff91a13f68a2e89 (diff)
downloadbitbake-16d5f40ad20fd08bf7a4d0e36200c739b5a9f59e.tar.gz
tests/data: Add a key deletion test
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@linuxfoundation.org>
Diffstat (limited to 'lib/bb/tests/data.py')
-rw-r--r--lib/bb/tests/data.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/bb/tests/data.py b/lib/bb/tests/data.py
index 9b09ff4c6..81e4091ff 100644
--- a/lib/bb/tests/data.py
+++ b/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()