Example #1
0
 def connectionMade(self):
     """Forward the command and arguments to the backend."""
     self.factory.deferred.callback(self)
     self.sendPacket(
         encode_request(
             self.factory.command, self.factory.pathname,
             self.factory.params))
Example #2
0
 def resumeProducing(self):
     # Send our translated request and then open the gate to the
     # client.
     if not self.request_sent:
         self.request_sent = True
         self.peer.sendPacket(
             encode_request(
                 self.command, self.pathname, self.params))
     PackServerProtocol.resumeProducing(self)
Example #3
0
 def test_with_parameters(self):
     self.assertEqual(
         b'git-do-stuff /some/path\0host=example.com\0user=foo=bar\0',
         helpers.encode_request(
             b'git-do-stuff', b'/some/path',
             {b'host': b'example.com', b'user': b'foo=bar'}))
Example #4
0
 def test_without_parameters(self):
     self.assertEqual(
         b'git-do-stuff /some/path\0',
         helpers.encode_request(b'git-do-stuff', b'/some/path', {}))