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 <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2014-12-23 12:33:48 +00:00
parent 4d06fb7307
commit 1d4908ddb2
1 changed files with 6 additions and 0 deletions

View File

@ -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()