From ff7892fa808116acc1ac50effa023a4cb031a5fc Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 16 Nov 2016 11:19:01 +0000 Subject: 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 --- lib/bb/tests/codeparser.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/bb/tests/codeparser.py') 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): -- cgit 1.2.3-korg