aboutsummaryrefslogtreecommitdiffstats
path: root/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:49 +0000
commitff7892fa808116acc1ac50effa023a4cb031a5fc (patch)
treeeac5dc67571cdd0202f6f75017616ed29866caed /lib/bb/tests/codeparser.py
parentcefb8c93c8299e68352cf7ec5ad9ca50c0d499ed (diff)
downloadbitbake-ff7892fa808116acc1ac50effa023a4cb031a5fc.tar.gz
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/tests/codeparser.py')
-rw-r--r--lib/bb/tests/codeparser.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/bb/tests/codeparser.py b/lib/bb/tests/codeparser.py
index 14f0e2572..b80c315d3 100644
--- a/lib/bb/tests/codeparser.py
+++ b/lib/bb/tests/codeparser.py
@@ -68,7 +68,7 @@ class VariableReferenceTest(ReferenceTest):
def test_python_reference(self):
self.setEmptyVars(["BAR"])
- self.parseExpression("${@bb.data.getVar('BAR', d, True) + 'foo'}")
+ self.parseExpression("${@d.getVar('BAR', True) + 'foo'}")
self.assertReferences(set(["BAR"]))
class ShellReferenceTest(ReferenceTest):
@@ -209,17 +209,17 @@ be. These unit tests are testing snippets."""
return " " + value
def test_getvar_reference(self):
- self.parseExpression("bb.data.getVar('foo', d, True)")
+ self.parseExpression("d.getVar('foo', True)")
self.assertReferences(set(["foo"]))
self.assertExecs(set())
def test_getvar_computed_reference(self):
- self.parseExpression("bb.data.getVar('f' + 'o' + 'o', d, True)")
+ self.parseExpression("d.getVar('f' + 'o' + 'o', True)")
self.assertReferences(set())
self.assertExecs(set())
def test_getvar_exec_reference(self):
- self.parseExpression("eval('bb.data.getVar(\"foo\", d, True)')")
+ self.parseExpression("eval('d.getVar(\"foo\", True)')")
self.assertReferences(set())
self.assertExecs(set(["eval"]))
@@ -269,7 +269,7 @@ be. These unit tests are testing snippets."""
class DependencyReferenceTest(ReferenceTest):
pydata = """
-bb.data.getVar('somevar', d, True)
+d.getVar('somevar', True)
def test(d):
foo = 'bar %s' % 'foo'
def test2(d):
@@ -285,9 +285,9 @@ def a():
test(d)
-bb.data.expand(bb.data.getVar("something", False, d), d)
+bb.data.expand(d.getVar("something", False), d)
bb.data.expand("${inexpand} somethingelse", d)
-bb.data.getVar(a(), d, False)
+d.getVar(a(), False)
"""
def test_python(self):