Browse Source

Fixes for paramiko vendor tests:

 * add missing "END PRIVATE KEY" trailer
 * wait for threads to terminate
 * run tests in normal test run
Jelmer Vernooij 2 years ago
parent
commit
1ecca25e8d
4 changed files with 12 additions and 6 deletions
  1. 3 0
      Makefile
  2. 3 0
      NEWS
  3. 1 0
      dulwich/contrib/__init__.py
  4. 5 6
      dulwich/contrib/test_paramiko_vendor.py

+ 3 - 0
Makefile

@@ -41,6 +41,9 @@ check-pypy:: clean
 check-noextensions:: clean
 	$(RUNTEST) dulwich.tests.test_suite
 
+check-contrib:: clean
+	$(RUNTEST) -v dulwich.contrib.test_suite
+
 check-all: check check-pypy check-noextensions
 
 typing:

+ 3 - 0
NEWS

@@ -3,6 +3,9 @@
  * Add ``walk_untracked`` argument to ``porcelain.status``.
    (Daniele Trifirò)
 
+ * Add tests for paramiko SSH Vendor.
+   (Filipp Frizzy)
+
 0.20.35	2022-03-20
 
  * Document the ``path`` attribute for ``Repo``.

+ 1 - 0
dulwich/contrib/__init__.py

@@ -23,6 +23,7 @@ def test_suite():
     import unittest
 
     names = [
+        "paramiko_vendor",
         "release_robot",
         "swift",
     ]

+ 5 - 6
dulwich/contrib/test_paramiko_vendor.py

@@ -26,10 +26,7 @@ import threading
 from dulwich.tests import TestCase
 from dulwich.contrib.paramiko_vendor import ParamikoSSHVendor
 
-try:
-    from StringIO import StringIO
-except ImportError:
-    from io import StringIO
+from io import StringIO
 
 
 USER = 'testuser'
@@ -60,7 +57,8 @@ cNj+6W2guZ2tyHuPhZ64/4SJVyE2hKDSKD4xTb2nVjsMeN0bLD2UWXC9mwbx8nWa
 R6legDG2e/50ph7yc8gwAaA1kUXMiuLi8Nfkw/3yyvmJwklNegi4aRzRbA2Mzhi2
 4q9WMQKBgQCb0JNyxHG4pvLWCF/j0Sm1FfvrpnqSv5678n1j4GX7Ka/TubOK1Y4K
 U+Oib7dKa/zQMWehVFNTayrsq6bKVZ6q7zG+IHiRLw4wjeAxREFH6WUjDrn9vl2l
-D48DKbBuBwuVOJWyq3qbfgJXojscgNQklrsPdXVhDwOF0dYxP89HnA=="""
+D48DKbBuBwuVOJWyq3qbfgJXojscgNQklrsPdXVhDwOF0dYxP89HnA==
+-----END RSA PRIVATE KEY-----"""
 CLIENT_KEY = """\
 -----BEGIN RSA PRIVATE KEY-----
 MIIEpAIBAAKCAQEAxvREKSElPOm/0z/nPO+j5rk2tjdgGcGc7We1QZ6TRXYLu7nN
@@ -122,6 +120,7 @@ class Server(paramiko.ServerInterface):
 
 
 class ParamikoSSHVendorTests(TestCase):
+
     def setUp(self):
         self.commands = []
         socket.setdefaulttimeout(10)
@@ -135,7 +134,7 @@ class ParamikoSSHVendorTests(TestCase):
         self.thread.start()
 
     def tearDown(self):
-        pass
+        self.thread.join()
 
     def _run(self):
         try: