tests/data: Add a key deletion test
PATCH 1/1 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 <[email protected]>
bitbake/lib/bb/tests/data.py +6 -0
@@ -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()