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

Method testImportFrom

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

Source from the content-addressed store, hash-verified

261
262
263 def testImportFrom(self):
264 self.maxDiff = None
265
266 fileNode = splootFromPython('from random import randint')
267 self.assertEqual(fileNode, {
268 'type': 'PYTHON_FILE',
269 'childSets': {'body': [
270 {
271 "type": "PYTHON_STATEMENT",
272 "childSets": {
273 "statement": [{
274 'type': 'PYTHON_FROM_IMPORT',
275 'childSets': {
276 'attrs': [
277 {'type': 'PY_IDENTIFIER', 'childSets': {}, 'properties': {'identifier': 'randint'}}
278 ],
279 'module': [
280 {'type': 'PYTHON_MODULE_IDENTIFIER', 'childSets': {}, 'properties': {'identifier': 'random'}}
281 ]
282 },
283 'properties': {},
284 }]
285 },
286 'properties': {},
287 }
288 ]},
289 'properties': {},
290 })
291
292 def testTuple(self):
293 self.maxDiff = None

Callers

nothing calls this directly

Calls 1

splootFromPythonFunction · 0.90

Tested by

no test coverage detected