Esempio n. 1
0
    def test_log_error(self, bright_mock, red_mock, reset_mock, stdout_mock):
        bright_mock.__str__.return_value = '@'
        red_mock.__str__.return_value = '<|||>'
        reset_mock.__str__.return_value = '__R__'

        cli.log_error('mystr')

        stdout_mock.assert_called_once_with('@<|||>ERROR__R__: mystr\n')
Esempio n. 2
0
def main():
    '''The entry point for Setuptools.'''
    from radon.cli import program, log_error

    try:
        program()
    except Exception as e:
        log_error(e)
Esempio n. 3
0
    def test_log_error(self, bright_mock, red_mock, reset_mock, stdout_mock):
        bright_mock.__str__.return_value = '@'
        red_mock.__str__.return_value = '<|||>'
        reset_mock.__str__.return_value = '__R__'

        cli.log_error('mystr')

        stdout_mock.assert_called_once_with('@<|||>ERROR__R__: mystr\n')
Esempio n. 4
0
def main():
    """The entry point for Setuptools."""
    from radon.cli import BAKER, log_error

    try:
        BAKER.run()
    except Exception as e:
        log_error(e)
        raise
Esempio n. 5
0
def main():
    '''The entry point for Setuptools.'''
    import sys
    from radon.cli import program, log_error

    if not sys.argv[1:]:
        sys.argv.append('-h')
    try:
        program()
    except Exception as e:
        log_error(e)
Esempio n. 6
0
def main():
    '''The entry point for Setuptools.'''
    import sys
    from radon.cli import program, log_error

    if not sys.argv[1:]:
        sys.argv.append('-h')
    try:
        program()
    except Exception as e:
        log_error(e)
Esempio n. 7
0
def test_log_error(mocker, stdout_mock):
    reset_mock = mocker.patch('radon.cli.RESET')
    red_mock = mocker.patch('radon.cli.RED')
    bright_mock = mocker.patch('radon.cli.BRIGHT')

    bright_mock.__str__.return_value = '@'
    red_mock.__str__.return_value = '<|||>'
    reset_mock.__str__.return_value = '__R__'

    cli.log_error('mystr')

    stdout_mock.assert_called_once_with('@<|||>ERROR__R__: mystr\n')