MCPcopy Create free account
hub / github.com/ipython/ipython / test_token_input_transformer

Function test_token_input_transformer

IPython/core/tests/test_inputtransformer.py:477–495  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

475
476
477def test_token_input_transformer():
478 tests = [(u'1.2', u_fmt(u"Decimal ('1.2')")),
479 (u'"1.2"', u'"1.2"'),
480 ]
481 tt.check_pairs(transform_and_reset(decistmt), tests)
482 ml_tests = \
483 [ [(u"a = 1.2; b = '''x", None),
484 (u"y'''", u_fmt(u"a =Decimal ('1.2');b ='''x\ny'''")),
485 ],
486 [(u"a = [1.2,", None),
487 (u"3]", u_fmt(u"a =[Decimal ('1.2'),\n3 ]")),
488 ],
489 [(u"a = '''foo", None), # Test resetting when within a multi-line string
490 (u"bar", None),
491 (None, u"a = '''foo\nbar"),
492 ],
493 ]
494 for example in ml_tests:
495 transform_checker(example, decistmt)

Callers

nothing calls this directly

Calls 2

transform_and_resetFunction · 0.85
transform_checkerFunction · 0.85

Tested by

no test coverage detected