瀏覽代碼

fix stules in paramoko tests

Filipp Frizzy 7 年之前
父節點
當前提交
afcfec8676
共有 1 個文件被更改,包括 21 次插入0 次删除
  1. 21 0
      dulwich/contrib/test_paramiko_vendor.py

+ 21 - 0
dulwich/contrib/test_paramiko_vendor.py

@@ -166,3 +166,24 @@ class ParamikoSSHVendorTests(TestCase):
             username=USER, port=self.port, pkey=key)
 
         self.assertIn(b'test_run_command_with_privkey', self.commands)
+
+    def test_run_command_data_transfer(self):
+        vendor = ParamikoSSHVendor(allow_agent=False, look_for_keys=False,)
+        con = vendor.run_command(
+            '127.0.0.1', 'test_run_command_data_transfer',
+            username=USER, port=self.port, password=PASSWORD)
+
+        self.assertIn(b'test_run_command_data_transfer', self.commands)
+
+        channel = self.transport.accept(5)
+        channel.send(b'stdout\n')
+        channel.send_stderr(b'stderr\n')
+        channel.close()
+
+        # Fixme: it's return false
+        # self.assertTrue(con.can_read())
+
+        self.assertEqual(b'stdout\n', con.read(4096))
+
+        # Fixme: it's return empty string
+        # self.assertEqual(b'stderr\n', con.read_stderr(4096))