예제 #1
0
def test_format_multiple():
    import pytest
    from pydevf import start_format_server
    from pydevf import format_code_server
    from pydevf import stop_format_server

    process = start_format_server()

    for _ in range(3):
        new_contents = format_code_server(process, code1)
        assert (repr(new_contents)) == repr(code1_expected)

        with pytest.raises(RuntimeError):
            format_code_server(process, code_error)

    stop_format_server(process)
예제 #2
0
    def format_code(code_to_format):
        if not formatter:
            _wait_current_processes()

            # Start-up pydevf server on demand.
            process = pydevf.start_format_server()
            formatter.append(process)
            _created_processes.append(process)
        return pydevf.format_code_server(formatter[0], code_to_format)
예제 #3
0
파일: cli.py 프로젝트: ESSS/esss_fix_format
    def format_code(code_to_format):
        if not formatter:
            _wait_current_processes()

            # Start-up pydevf server on demand.
            process = pydevf.start_format_server()
            formatter.append(process)
            _created_processes.append(process)
        return pydevf.format_code_server(formatter[0], code_to_format)
예제 #4
0
 def format_code(code_to_format):
     if not formatter:
         # Start-up pydevf server on demand.
         formatter.append(pydevf.start_format_server())
     return pydevf.format_code_server(formatter[0], code_to_format)