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

Method testSet

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

Source from the content-addressed store, hash-verified

350 })
351
352 def testSet(self):
353 self.maxDiff = None
354 fileNode = splootFromPython('{"hi"}\n{"a", "b"}')
355 self.assertEqual(fileNode, {
356 'type': 'PYTHON_FILE',
357 'childSets': {'body': [
358 {
359 'type': 'PYTHON_STATEMENT',
360 'meta': {'lineno': 1},
361 'childSets': {'statement': [
362 {'type': 'PYTHON_EXPRESSION', 'childSets': {'tokens': [
363 {'type': 'PY_SET', 'childSets': {'elements': [
364 {'type': 'PYTHON_EXPRESSION', 'childSets': {'tokens': [
365 {'type': 'STRING_LITERAL', 'properties': {'value': 'hi'}, 'childSets': {}}
366 ]}, 'properties': {}}
367 ]}, 'properties': {}}
368 ]}, 'properties': {}}
369 ]},
370 'properties': {},
371 },
372 {
373 'type': 'PYTHON_STATEMENT',
374 'meta': {'lineno': 2},
375 'childSets': {'statement': [
376 {'type': 'PYTHON_EXPRESSION', 'childSets': {'tokens': [
377 {'type': 'PY_SET', 'childSets': {'elements': [
378 {'type': 'PYTHON_EXPRESSION', 'childSets': {'tokens': [
379 {'type': 'STRING_LITERAL', 'properties': {'value': 'a'}, 'childSets': {}}
380 ]}, 'properties': {}},
381 {'type': 'PYTHON_EXPRESSION', 'childSets': {'tokens': [
382 {'type': 'STRING_LITERAL', 'properties': {'value': 'b'}, 'childSets': {}}
383 ]}, 'properties': {}}
384 ]}, 'properties': {}}
385 ]}, 'properties': {}}
386 ]},
387 'properties': {},
388 },
389 ]},
390 'properties': {},
391 })
392
393
394 def testElif(self):

Callers

nothing calls this directly

Calls 1

splootFromPythonFunction · 0.90

Tested by

no test coverage detected