def testErrorMessagesMentioningProxy(self):
        # CNY-1313

        # Lame HTTP server to act as a bogus HTTP proxy/Conary proxy
        class RequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
            def log_message(self, *args, **kw):
                pass

            def do_GET(self):
                self.send_response(200)
                response = 'Hello, world!\n'
                self.send_header('Content-type', 'text/unknown')
                self.send_header('Content-Length', len(response))
                self.end_headers()
                self.wfile.write(response)

        httpServer = rephelp.HTTPServerController(RequestHandler)
        sock_utils.tryConnect("localhost", httpServer.port)

        self.cfg.repositoryMap['localhost'] = 'http://localhost/conary/'
        self.cfg.configLine(httpServer.port % "conaryProxy http://localhost:%d")
        repos = conaryclient.ConaryClient(self.cfg).getRepos()
        try:
            repos.c['localhost'].getProtocolVersion()
        except errors.OpenError, e:
            self.assertEqual(str(e),
                    "Error opening http://test:<PASSWD>@localhost/conary/ via "
                    "conary proxy localhost:%d: 501 Unsupported method ('POST')"
                    % httpServer.port)
        else:
            self.fail("Should have failed")
        self.cfg.resetToDefault('conaryProxy')
dataset/ETHPy150Open sassoftware/conary/conary_test/repositorytest/netclienttest.py/NetclientTest.testErrorMessagesMentioningProxy/swapped operands of `%`