summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/tests/codeparser.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-11-16 11:19:01 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-11-23 10:59:56 +0000
commit8de811ae76f8a5bc160e3e3f72da3a5e08b6ca1a (patch)
treed05237b14523de16c128de71d99eed4f8f9e554e /bitbake/lib/bb/tests/codeparser.py
parent4d8ee55164303544c9cf9c9356448cbc79885815 (diff)
downloadpoky-8de811ae76f8a5bc160e3e3f72da3a5e08b6ca1a.tar.gz
bitbake: lib/bb: Don't use deprecated bb.data.getVar/setVar API
The old style bb.data.getVar/setVar API is obsolete. Most of bitbake doesn't use it but there were some pieces that escaped conversion. This patch fixes the remaining users mostly in the fetchers. (Bitbake rev: ff7892fa808116acc1ac50effa023a4cb031a5fc) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/tests/codeparser.py')
-rw-r--r--bitbake/lib/bb/tests/codeparser.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/bitbake/lib/bb/tests/codeparser.py b/bitbake/lib/bb/tests/codeparser.py
index 14f0e2572c..b80c315d3d 100644
--- a/bitbake/lib/bb/tests/codeparser.py
+++ b/bitbake/lib/bb/tests/codeparser.py
@@ -68,7 +68,7 @@ class VariableReferenceTest(ReferenceTest):
68 68
69 def test_python_reference(self): 69 def test_python_reference(self):
70 self.setEmptyVars(["BAR"]) 70 self.setEmptyVars(["BAR"])
71 self.parseExpression("${@bb.data.getVar('BAR', d, True) + 'foo'}") 71 self.parseExpression("${@d.getVar('BAR', True) + 'foo'}")
72 self.assertReferences(set(["BAR"])) 72 self.assertReferences(set(["BAR"]))
73 73
74class ShellReferenceTest(ReferenceTest): 74class ShellReferenceTest(ReferenceTest):
@@ -209,17 +209,17 @@ be. These unit tests are testing snippets."""
209 return " " + value 209 return " " + value
210 210
211 def test_getvar_reference(self): 211 def test_getvar_reference(self):
212 self.parseExpression("bb.data.getVar('foo', d, True)") 212 self.parseExpression("d.getVar('foo', True)")
213 self.assertReferences(set(["foo"])) 213 self.assertReferences(set(["foo"]))
214 self.assertExecs(set()) 214 self.assertExecs(set())
215 215
216 def test_getvar_computed_reference(self): 216 def test_getvar_computed_reference(self):
217 self.parseExpression("bb.data.getVar('f' + 'o' + 'o', d, True)") 217 self.parseExpression("d.getVar('f' + 'o' + 'o', True)")
218 self.assertReferences(set()) 218 self.assertReferences(set())
219 self.assertExecs(set()) 219 self.assertExecs(set())
220 220
221 def test_getvar_exec_reference(self): 221 def test_getvar_exec_reference(self):
222 self.parseExpression("eval('bb.data.getVar(\"foo\", d, True)')") 222 self.parseExpression("eval('d.getVar(\"foo\", True)')")
223 self.assertReferences(set()) 223 self.assertReferences(set())
224 self.assertExecs(set(["eval"])) 224 self.assertExecs(set(["eval"]))
225 225
@@ -269,7 +269,7 @@ be. These unit tests are testing snippets."""
269class DependencyReferenceTest(ReferenceTest): 269class DependencyReferenceTest(ReferenceTest):
270 270
271 pydata = """ 271 pydata = """
272bb.data.getVar('somevar', d, True) 272d.getVar('somevar', True)
273def test(d): 273def test(d):
274 foo = 'bar %s' % 'foo' 274 foo = 'bar %s' % 'foo'
275def test2(d): 275def test2(d):
@@ -285,9 +285,9 @@ def a():
285 285
286test(d) 286test(d)
287 287
288bb.data.expand(bb.data.getVar("something", False, d), d) 288bb.data.expand(d.getVar("something", False), d)
289bb.data.expand("${inexpand} somethingelse", d) 289bb.data.expand("${inexpand} somethingelse", d)
290bb.data.getVar(a(), d, False) 290d.getVar(a(), False)
291""" 291"""
292 292
293 def test_python(self): 293 def test_python(self):