Openembedded Bitbake Development
 help / color / mirror / Atom feed
* [PATCH] tests/data: Add a key deletion test
@ 2014-12-23 12:33 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2014-12-23 12:33 UTC (permalink / raw)
  To: bitbake-devel

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>

diff --git a/bitbake/lib/bb/tests/data.py b/bitbake/lib/bb/tests/data.py
index 9b09ff4..81e4091 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()




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-12-23 12:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-23 12:33 [PATCH] tests/data: Add a key deletion test Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox