@patch('prestoadmin.util.application.os.path.exists')
    @patch('prestoadmin.util.application.sys.stderr')
    def test_configures_invalid_log_file(
        self,
        stderr_mock,
        path_exists_mock,
        logging_mock,
        filesystem_mock
    ):
        path_exists_mock.return_value = True

        expected_error = FakeError('Error')
        logging_mock.fileConfig.side_effect = expected_error

        try:
            with Application(APPLICATION_NAME):
                pass
        except __HOLE__ as e:
            self.assertEqual('Error', e.message)

        stderr_mock.write.assert_has_calls(
            [
                call('Please run %s with sudo.\n' % APPLICATION_NAME),
            ]
        )
dataset/ETHPy150Open prestodb/presto-admin/tests/unit/util/test_application.py/ApplicationTest.test_configures_invalid_log_file