diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-12-23 12:33:48 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-12-25 08:18:14 +0000 |
commit | 1d4908ddb224ccc7e018b485e8e52d7ec2b70b81 (patch) | |
tree | 3e43bdd71aae5df8fb36dc2d21e2a5dd35529a62 | |
parent | 4d06fb730798297c994961dfb0f9b601fa618c3b (diff) | |
download | poky-1d4908ddb224ccc7e018b485e8e52d7ec2b70b81.tar.gz |
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>
-rw-r--r-- | bitbake/lib/bb/tests/data.py | 6 |
1 files changed, 6 insertions, 0 deletions
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): | |||
121 | keys = self.d.keys() | 121 | keys = self.d.keys() |
122 | self.assertEqual(keys, ['value_of_foo', 'foo', 'bar']) | 122 | self.assertEqual(keys, ['value_of_foo', 'foo', 'bar']) |
123 | 123 | ||
124 | def test_keys_deletion(self): | ||
125 | newd = bb.data.createCopy(self.d) | ||
126 | newd.delVar("bar") | ||
127 | keys = newd.keys() | ||
128 | self.assertEqual(keys, ['value_of_foo', 'foo']) | ||
129 | |||
124 | class TestNestedExpansions(unittest.TestCase): | 130 | class TestNestedExpansions(unittest.TestCase): |
125 | def setUp(self): | 131 | def setUp(self): |
126 | self.d = bb.data.init() | 132 | self.d = bb.data.init() |