davemds pushed a commit to branch master.
commit 92a626abbc662c5d9d7f38ac6d53d4e0a6ad35ec
Author: davemds <[email protected]>
Date: Wed Apr 3 11:38:46 2013 +0200
Python-EFL: fix ecore.file_download_protocol_available for py3, and made a
test for it
---
efl/ecore/efl.ecore_file_download.pxi | 4 +++-
tests/ecore/test_08_file_download.py | 2 ++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/efl/ecore/efl.ecore_file_download.pxi
b/efl/ecore/efl.ecore_file_download.pxi
index 91b02dd..9fc3f32 100644
--- a/efl/ecore/efl.ecore_file_download.pxi
+++ b/efl/ecore/efl.ecore_file_download.pxi
@@ -182,4 +182,6 @@ def file_download_protocol_available(protocol):
:return: True if the protocol is supported
:rtype: bool
"""
- return bool(ecore_file_download_protocol_available(protocol))
+ if isinstance(protocol, unicode): protocol = protocol.encode("UTF-8")
+ return bool(ecore_file_download_protocol_available(
+ <const_char *>protocol if protocol is not None else NULL))
diff --git a/tests/ecore/test_08_file_download.py
b/tests/ecore/test_08_file_download.py
index fb4980b..65cec70 100644
--- a/tests/ecore/test_08_file_download.py
+++ b/tests/ecore/test_08_file_download.py
@@ -21,6 +21,8 @@ class TestFileDownload(unittest.TestCase):
if os.path.exists(dst):
os.remove(dst)
+ self.assertEqual(ecore.file_download_protocol_available('http://'),
True)
+
ecore.FileDownload("http://www.google.com", dst,
completion_cb = _completion_cb,
progress_cb = _progress_cb)
--
------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire
the most talented Cisco Certified professionals. Visit the
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html