forked from pool/python-pycurl
- Switch to %pyproject_*.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pycurl?expand=0&rev=112
This commit is contained in:
66
pycurl-libssh.patch
Normal file
66
pycurl-libssh.patch
Normal file
@@ -0,0 +1,66 @@
|
||||
---
|
||||
tests/ssh_key_cb_test.py | 31 +++++++++++++++++++++++--------
|
||||
1 file changed, 23 insertions(+), 8 deletions(-)
|
||||
|
||||
--- a/tests/ssh_key_cb_test.py
|
||||
+++ b/tests/ssh_key_cb_test.py
|
||||
@@ -33,8 +33,11 @@ class SshKeyCbTest(unittest.TestCase):
|
||||
def keyfunction(known_key, found_key, match):
|
||||
return pycurl.KHSTAT_FINE
|
||||
|
||||
- self.curl.setopt(pycurl.SSH_KNOWNHOSTS, '.known_hosts')
|
||||
- self.curl.setopt(pycurl.SSH_KEYFUNCTION, keyfunction)
|
||||
+ try:
|
||||
+ self.curl.setopt(pycurl.SSH_KNOWNHOSTS, '.known_hosts')
|
||||
+ self.curl.setopt(pycurl.SSH_KEYFUNCTION, keyfunction)
|
||||
+ except pycurl.error as e:
|
||||
+ self.assertEqual(pycurl.E_UNKNOWN_OPTION, e.args[0])
|
||||
|
||||
try:
|
||||
self.curl.perform()
|
||||
@@ -47,8 +50,11 @@ class SshKeyCbTest(unittest.TestCase):
|
||||
def keyfunction(known_key, found_key, match):
|
||||
return pycurl.KHSTAT_REJECT
|
||||
|
||||
- self.curl.setopt(pycurl.SSH_KNOWNHOSTS, '.known_hosts')
|
||||
- self.curl.setopt(pycurl.SSH_KEYFUNCTION, keyfunction)
|
||||
+ try:
|
||||
+ self.curl.setopt(pycurl.SSH_KNOWNHOSTS, '.known_hosts')
|
||||
+ self.curl.setopt(pycurl.SSH_KEYFUNCTION, keyfunction)
|
||||
+ except pycurl.error as e:
|
||||
+ self.assertEqual(pycurl.E_UNKNOWN_OPTION, e.args[0])
|
||||
|
||||
try:
|
||||
self.curl.perform()
|
||||
@@ -62,8 +68,11 @@ class SshKeyCbTest(unittest.TestCase):
|
||||
def keyfunction(known_key, found_key, match):
|
||||
return 'bogus'
|
||||
|
||||
- self.curl.setopt(pycurl.SSH_KNOWNHOSTS, '.known_hosts')
|
||||
- self.curl.setopt(pycurl.SSH_KEYFUNCTION, keyfunction)
|
||||
+ try:
|
||||
+ self.curl.setopt(pycurl.SSH_KNOWNHOSTS, '.known_hosts')
|
||||
+ self.curl.setopt(pycurl.SSH_KEYFUNCTION, keyfunction)
|
||||
+ except pycurl.error as e:
|
||||
+ self.assertEqual(pycurl.E_UNKNOWN_OPTION, e.args[0])
|
||||
|
||||
try:
|
||||
self.curl.perform()
|
||||
@@ -82,9 +91,15 @@ class SshKeyCbUnsetTest(unittest.TestCas
|
||||
@util.min_libcurl(7, 19, 6)
|
||||
@util.guard_unknown_libcurl_option
|
||||
def test_keyfunction_none(self):
|
||||
- self.curl.setopt(pycurl.SSH_KEYFUNCTION, None)
|
||||
+ try:
|
||||
+ self.curl.setopt(pycurl.SSH_KEYFUNCTION, None)
|
||||
+ except pycurl.error as e:
|
||||
+ self.assertEqual(pycurl.E_UNKNOWN_OPTION, e.args[0])
|
||||
|
||||
@util.min_libcurl(7, 19, 6)
|
||||
@util.guard_unknown_libcurl_option
|
||||
def test_keyfunction_unset(self):
|
||||
- self.curl.unsetopt(pycurl.SSH_KEYFUNCTION)
|
||||
+ try:
|
||||
+ self.curl.unsetopt(pycurl.SSH_KEYFUNCTION)
|
||||
+ except pycurl.error as e:
|
||||
+ self.assertEqual(pycurl.E_UNKNOWN_OPTION, e.args[0])
|
||||
Reference in New Issue
Block a user