@patch('prestoadmin.connector.sudo')
    @patch('prestoadmin.connector.os.path.exists')
    def test_remove_no_such_file(self, exists_mock, sudo_mock):
        exists_mock.return_value = False
        fabric.api.env.host = 'localhost'
        error_msg = ('Could not remove connector tpch: No such file '
                     '/etc/opt/prestoadmin/connectors/tpch.properties')
        out = _AttributeString(error_msg)
        out.succeeded = True
        sudo_mock.return_value = out
        self.assertRaisesRegexp(SystemExit,
                                '\\[localhost\\] %s' % error_msg,
                                connector.remove,
                                'tpch')
dataset/ETHPy150Open prestodb/presto-admin/tests/unit/test_connector.py/TestConnector.test_remove_no_such_file/original