def test_format_input_multi(self): code = dedent('''\ def f(x): return x''') expected = dedent('''\ >>> def f(x): >>> return x''') result = R.format_input_prompt('>>> ', code, None) assert result == expected
def test_format_input_multi(self): code = dedent('''\ def f(x): return x + 2 f(2) ''').strip() expected = dedent('''\ In [10]: def f(x): ...: return x + 2 ...: ...: f(2) ''').strip() result = R.format_input_prompt(code, 10) assert result == expected
def test_format_input(self): code = '2 + 2' expected = '>>> 2 + 2' result = R.format_input_prompt('>>> ', code, None) assert result == expected
def test_format_input_none(self): code = 'abcde' result = R.format_input_prompt(code, None) assert result == code
def test_format_input(self): code = '2 + 2' expected = 'In [1]: 2 + 2' result = R.format_input_prompt(code, 1) assert result == expected