Browse Source

Explicitly reenable paramiko server on Gentoo for tests

Gentoo patches out server support from paramiko for security reasons.
Since dulwich uses it only for testing, use the knob to explicitly
reenable it.
Michał Górny 3 năm trước cách đây
mục cha
commit
07ac694d25
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 6 0
      dulwich/contrib/test_paramiko_vendor.py

+ 6 - 0
dulwich/contrib/test_paramiko_vendor.py

@@ -122,6 +122,12 @@ class Server(paramiko.ServerInterface):
 class ParamikoSSHVendorTests(TestCase):
 
     def setUp(self):
+        import paramiko.transport
+
+        # reenable server functionality for tests
+        if hasattr(paramiko.transport, "SERVER_DISABLED_BY_GENTOO"):
+            paramiko.transport.SERVER_DISABLED_BY_GENTOO = False
+
         self.commands = []
         socket.setdefaulttimeout(10)
         self.addCleanup(socket.setdefaulttimeout, None)