Example #1
0
    def test_with_diff(self):
        isort_output = """ERROR: /path/to/foobar.py Imports are incorrectly sorted.
            --- /path/to/foobar.py:before
            +++ /path/to/foobar.py:after
            @@ 123,123
            +import logging
             import os
             import tempfile
            -import logging"""

        expected_output = """ERROR: /path/to/foobar.py Imports are incorrectly sorted.

            +import logging
             import os
             import tempfile
            -import logging"""

        assert IsortError(isort_output).simplified_error() == expected_output
Example #2
0
 def test_no_diff(self):
     expected = 'FOOBAR: Lorem ipsum 123'
     assert IsortError(
         'FOOBAR: Lorem ipsum 123').simplified_error() == expected
Example #3
0
 def test_no_output(self):
     assert IsortError('').simplified_error() == ''