summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/tests
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-06-18 15:14:19 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-06-23 11:57:53 +0100
commit69b69193411849de71cf7c81735c3239e28a2940 (patch)
tree054081264a49c9aa3002bc358ab0c4d7b7239015 /bitbake/lib/bb/tests
parent86d30d756a60d181a95cf07041920a367a0cd0ba (diff)
downloadpoky-69b69193411849de71cf7c81735c3239e28a2940.tar.gz
bitbake: bitbake: Add explict getVar param for (non) expansion
Rather than just use d.getVar(X), use the more explict d.getVar(X, False) since at some point in the future, having the default of expansion would be nice. This is the first step towards that. This patch was mostly made using the command: sed -e 's:\(getVar([^,()]*\)\s*):\1, False):g' -i `grep -ril getVar *` (Bitbake rev: 659ef95c9b8aced3c4ded81c48bcc0fbde4d429f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/tests')
-rw-r--r--bitbake/lib/bb/tests/data.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/bitbake/lib/bb/tests/data.py b/bitbake/lib/bb/tests/data.py
index e285c223dc..2c2e7ae48b 100644
--- a/bitbake/lib/bb/tests/data.py
+++ b/bitbake/lib/bb/tests/data.py
@@ -134,12 +134,12 @@ class DataExpansions(unittest.TestCase):
134 134
135 def test_rename(self): 135 def test_rename(self):
136 self.d.renameVar("foo", "newfoo") 136 self.d.renameVar("foo", "newfoo")
137 self.assertEqual(self.d.getVar("newfoo"), "value_of_foo") 137 self.assertEqual(self.d.getVar("newfoo", False), "value_of_foo")
138 self.assertEqual(self.d.getVar("foo"), None) 138 self.assertEqual(self.d.getVar("foo", False), None)
139 139
140 def test_deletion(self): 140 def test_deletion(self):
141 self.d.delVar("foo") 141 self.d.delVar("foo")
142 self.assertEqual(self.d.getVar("foo"), None) 142 self.assertEqual(self.d.getVar("foo", False), None)
143 143
144 def test_keys(self): 144 def test_keys(self):
145 keys = self.d.keys() 145 keys = self.d.keys()
@@ -196,28 +196,28 @@ class TestMemoize(unittest.TestCase):
196 def test_memoized(self): 196 def test_memoized(self):
197 d = bb.data.init() 197 d = bb.data.init()
198 d.setVar("FOO", "bar") 198 d.setVar("FOO", "bar")
199 self.assertTrue(d.getVar("FOO") is d.getVar("FOO")) 199 self.assertTrue(d.getVar("FOO", False) is d.getVar("FOO", False))
200 200
201 def test_not_memoized(self): 201 def test_not_memoized(self):
202 d1 = bb.data.init() 202 d1 = bb.data.init()
203 d2 = bb.data.init() 203 d2 = bb.data.init()
204 d1.setVar("FOO", "bar") 204 d1.setVar("FOO", "bar")
205 d2.setVar("FOO", "bar2") 205 d2.setVar("FOO", "bar2")
206 self.assertTrue(d1.getVar("FOO") is not d2.getVar("FOO")) 206 self.assertTrue(d1.getVar("FOO", False) is not d2.getVar("FOO", False))
207 207
208 def test_changed_after_memoized(self): 208 def test_changed_after_memoized(self):
209 d = bb.data.init() 209 d = bb.data.init()
210 d.setVar("foo", "value of foo") 210 d.setVar("foo", "value of foo")
211 self.assertEqual(str(d.getVar("foo")), "value of foo") 211 self.assertEqual(str(d.getVar("foo", False)), "value of foo")
212 d.setVar("foo", "second value of foo") 212 d.setVar("foo", "second value of foo")
213 self.assertEqual(str(d.getVar("foo")), "second value of foo") 213 self.assertEqual(str(d.getVar("foo", False)), "second value of foo")
214 214
215 def test_same_value(self): 215 def test_same_value(self):
216 d = bb.data.init() 216 d = bb.data.init()
217 d.setVar("foo", "value of") 217 d.setVar("foo", "value of")
218 d.setVar("bar", "value of") 218 d.setVar("bar", "value of")
219 self.assertEqual(d.getVar("foo"), 219 self.assertEqual(d.getVar("foo", False),
220 d.getVar("bar")) 220 d.getVar("bar", False))
221 221
222class TestConcat(unittest.TestCase): 222class TestConcat(unittest.TestCase):
223 def setUp(self): 223 def setUp(self):