← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~pappacena/turnip:fix-setenv-regression into turnip:master

 

Thiago F. Pappacena has proposed merging ~pappacena/turnip:fix-setenv-regression into turnip:master.

Commit message:
Fixing SSH frontend set env regression

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~pappacena/turnip/+git/turnip/+merge/396348
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~pappacena/turnip:fix-setenv-regression into turnip:master.
diff --git a/turnip/pack/ssh.py b/turnip/pack/ssh.py
index 1d4c79b..0f27390 100644
--- a/turnip/pack/ssh.py
+++ b/turnip/pack/ssh.py
@@ -121,6 +121,7 @@ class SSHPackClientFactory(protocol.ClientFactory):
         self.deferred.errback(reason)
 
 
+@implementer(ISession, ISessionSetEnv)
 class SmartSSHSession(DoNothingSession):
     """SSH session allowing only Git smart SSH requests."""
 
diff --git a/turnip/pack/tests/test_ssh.py b/turnip/pack/tests/test_ssh.py
index 12f5dfb..d0e7f14 100644
--- a/turnip/pack/tests/test_ssh.py
+++ b/turnip/pack/tests/test_ssh.py
@@ -8,12 +8,18 @@ from __future__ import (
     )
 
 from testtools import TestCase
+from twisted.conch.interfaces import ISession, ISessionSetEnv
 
 from turnip.pack.ssh import SmartSSHSession
 
 
 class TestSSHSessionProtocolVersion(TestCase):
     """Tests that SSH session gets protocol version from env variable."""
+    def test_implements_env_interfaces(self):
+        session = SmartSSHSession(None)
+        self.assertTrue(ISession.providedBy(session))
+        self.assertTrue(ISessionSetEnv.providedBy(session))
+
     def test_getProtocolVersion_default_zero(self):
         session = SmartSSHSession(None)
         self.assertEqual(b'0', session.getProtocolVersion())