From 1d4908ddb224ccc7e018b485e8e52d7ec2b70b81 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 23 Dec 2014 12:33:48 +0000 Subject: bitbake: 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. (Bitbake rev: 16d5f40ad20fd08bf7a4d0e36200c739b5a9f59e) Signed-off-by: Richard Purdie --- bitbake/lib/bb/tests/data.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'bitbake/lib/bb/tests') diff --git a/bitbake/lib/bb/tests/data.py b/bitbake/lib/bb/tests/data.py index 9b09ff4c61..81e4091ff7 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() -- cgit v1.2.3-54-g00ecf