summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/tests/parse.py
diff options
context:
space:
mode:
authorJoshua Lock <joshua.g.lock@intel.com>2016-11-25 15:28:08 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-11-30 15:48:09 +0000
commit1fce7ecbbb004a5ad82da3eef79cfd52b276708d (patch)
treedc19c8ecb8e0b04ba5eafd27a7679bb55585a868 /bitbake/lib/bb/tests/parse.py
parent1d0c124cdf0282b8d139063409e40982f0ec9888 (diff)
downloadpoky-1fce7ecbbb004a5ad82da3eef79cfd52b276708d.tar.gz
bitbake: bitbake: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True option from getVar() calls with a regex search and replace. Search made with the following regex: getVar ?\(( ?[^,()]*), True\) (Bitbake rev: 3b45c479de8640f92dd1d9f147b02e1eecfaadc8) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/tests/parse.py')
-rw-r--r--bitbake/lib/bb/tests/parse.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/bitbake/lib/bb/tests/parse.py b/bitbake/lib/bb/tests/parse.py
index 0b2706af02..86e86ed711 100644
--- a/bitbake/lib/bb/tests/parse.py
+++ b/bitbake/lib/bb/tests/parse.py
@@ -58,9 +58,9 @@ C = "3"
58 def test_parse_simple(self): 58 def test_parse_simple(self):
59 f = self.parsehelper(self.testfile) 59 f = self.parsehelper(self.testfile)
60 d = bb.parse.handle(f.name, self.d)[''] 60 d = bb.parse.handle(f.name, self.d)['']
61 self.assertEqual(d.getVar("A", True), "1") 61 self.assertEqual(d.getVar("A"), "1")
62 self.assertEqual(d.getVar("B", True), "2") 62 self.assertEqual(d.getVar("B"), "2")
63 self.assertEqual(d.getVar("C", True), "3") 63 self.assertEqual(d.getVar("C"), "3")
64 64
65 def test_parse_incomplete_function(self): 65 def test_parse_incomplete_function(self):
66 testfileB = self.testfile.replace("}", "") 66 testfileB = self.testfile.replace("}", "")
@@ -80,9 +80,9 @@ unset B[flag]
80 def test_parse_unset(self): 80 def test_parse_unset(self):
81 f = self.parsehelper(self.unsettest) 81 f = self.parsehelper(self.unsettest)
82 d = bb.parse.handle(f.name, self.d)[''] 82 d = bb.parse.handle(f.name, self.d)['']
83 self.assertEqual(d.getVar("A", True), None) 83 self.assertEqual(d.getVar("A"), None)
84 self.assertEqual(d.getVarFlag("A","flag", True), None) 84 self.assertEqual(d.getVarFlag("A","flag", True), None)
85 self.assertEqual(d.getVar("B", True), "2") 85 self.assertEqual(d.getVar("B"), "2")
86 86
87 87
88 overridetest = """ 88 overridetest = """
@@ -95,11 +95,11 @@ PN = "gtk+"
95 def test_parse_overrides(self): 95 def test_parse_overrides(self):
96 f = self.parsehelper(self.overridetest) 96 f = self.parsehelper(self.overridetest)
97 d = bb.parse.handle(f.name, self.d)[''] 97 d = bb.parse.handle(f.name, self.d)['']
98 self.assertEqual(d.getVar("RRECOMMENDS", True), "b") 98 self.assertEqual(d.getVar("RRECOMMENDS"), "b")
99 bb.data.expandKeys(d) 99 bb.data.expandKeys(d)
100 self.assertEqual(d.getVar("RRECOMMENDS", True), "b") 100 self.assertEqual(d.getVar("RRECOMMENDS"), "b")
101 d.setVar("RRECOMMENDS_gtk+", "c") 101 d.setVar("RRECOMMENDS_gtk+", "c")
102 self.assertEqual(d.getVar("RRECOMMENDS", True), "c") 102 self.assertEqual(d.getVar("RRECOMMENDS"), "c")
103 103
104 overridetest2 = """ 104 overridetest2 = """
105EXTRA_OECONF = "" 105EXTRA_OECONF = ""
@@ -112,7 +112,7 @@ EXTRA_OECONF_append = " c"
112 d = bb.parse.handle(f.name, self.d)[''] 112 d = bb.parse.handle(f.name, self.d)['']
113 d.appendVar("EXTRA_OECONF", " d") 113 d.appendVar("EXTRA_OECONF", " d")
114 d.setVar("OVERRIDES", "class-target") 114 d.setVar("OVERRIDES", "class-target")
115 self.assertEqual(d.getVar("EXTRA_OECONF", True), "b c d") 115 self.assertEqual(d.getVar("EXTRA_OECONF"), "b c d")
116 116
117 overridetest3 = """ 117 overridetest3 = """
118DESCRIPTION = "A" 118DESCRIPTION = "A"
@@ -124,11 +124,11 @@ PN = "bc"
124 f = self.parsehelper(self.overridetest3) 124 f = self.parsehelper(self.overridetest3)
125 d = bb.parse.handle(f.name, self.d)[''] 125 d = bb.parse.handle(f.name, self.d)['']
126 bb.data.expandKeys(d) 126 bb.data.expandKeys(d)
127 self.assertEqual(d.getVar("DESCRIPTION_bc-dev", True), "A B") 127 self.assertEqual(d.getVar("DESCRIPTION_bc-dev"), "A B")
128 d.setVar("DESCRIPTION", "E") 128 d.setVar("DESCRIPTION", "E")
129 d.setVar("DESCRIPTION_bc-dev", "C D") 129 d.setVar("DESCRIPTION_bc-dev", "C D")
130 d.setVar("OVERRIDES", "bc-dev") 130 d.setVar("OVERRIDES", "bc-dev")
131 self.assertEqual(d.getVar("DESCRIPTION", True), "C D") 131 self.assertEqual(d.getVar("DESCRIPTION"), "C D")
132 132
133 133
134 classextend = """ 134 classextend = """
@@ -159,6 +159,6 @@ python () {
159 alldata = bb.parse.handle(f.name, self.d) 159 alldata = bb.parse.handle(f.name, self.d)
160 d1 = alldata[''] 160 d1 = alldata['']
161 d2 = alldata[cls.name] 161 d2 = alldata[cls.name]
162 self.assertEqual(d1.getVar("VAR_var", True), "B") 162 self.assertEqual(d1.getVar("VAR_var"), "B")
163 self.assertEqual(d2.getVar("VAR_var", True), None) 163 self.assertEqual(d2.getVar("VAR_var"), None)
164 164