MCPcopy Create free account
hub / github.com/SplootCode/splootcode / testList

Method testList

python/tests/test_convert_ast.py:176–234  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

174})
175
176 def testList(self):
177 self.maxDiff = None
178
179 fileNode = splootFromPython('x = ["hello", 234]')
180 self.assertEqual(fileNode, {
181"type":"PYTHON_FILE",
182"properties":{},
183"childSets":{
184 "body": [
185 {
186 "type": "PYTHON_STATEMENT",
187 'meta': {'lineno': 1},
188 "childSets": {
189 "statement": [{
190 "type": 'PYTHON_ASSIGNMENT',
191 "childSets": {
192 "left": [{
193 "type": "PY_IDENTIFIER",
194 "childSets": {},
195 "properties": {"identifier": 'x'}
196 }],
197 "right": [{
198 "type": "PYTHON_EXPRESSION",
199 "childSets": {
200 "tokens": [
201 {
202 "type": "PYTHON_LIST",
203 "childSets": {
204 "elements": [
205 {
206 "type": "PYTHON_EXPRESSION",
207 "childSets": {
208 "tokens": [{"type": "STRING_LITERAL", "childSets": {}, "properties": {"value": "hello"}}]
209 },
210 "properties": {}
211 },
212 {
213 "type": "PYTHON_EXPRESSION",
214 "childSets": {
215 "tokens": [{"type": "NUMERIC_LITERAL", "childSets": {}, "properties": {"value": 234}}]
216 },
217 "properties": {}
218 },
219 ]
220 },
221 "properties": {}
222 }
223 ]
224 },
225 "properties": {}
226 }]
227 },
228 "properties": {}
229 }]
230 },
231 "properties": {},
232 }
233 ]

Callers

nothing calls this directly

Calls 1

splootFromPythonFunction · 0.90

Tested by

no test coverage detected