diff tests/hghave @ 12740:b86c6954ec4c

serve: fix https mode and add test The https mode failed in super because BaseRequestHandler is an old-style class. This introduces the first test of https client/server functionality - and "hghave ssl". The test is currently only run on Python 2.6.
author Mads Kiilerich <mads@kiilerich.com>
date Sun, 17 Oct 2010 04:13:35 +0200
parents cbe400a8e217
children 763be3cd084a
line wrap: on
line diff
--- a/tests/hghave	Sat Oct 16 17:29:04 2010 -0500
+++ b/tests/hghave	Sun Oct 17 04:13:35 2010 +0200
@@ -179,12 +179,21 @@
 def has_outer_repo():
     return matchoutput('hg root 2>&1', r'')
 
+def has_ssl():
+    try:
+        from OpenSSL.SSL import SysCallError, ZeroReturnError
+        import ssl
+        return True
+    except ImportError:
+        return False
+
 checks = {
     "baz": (has_baz, "GNU Arch baz client"),
     "bzr": (has_bzr, "Canonical's Bazaar client"),
     "bzr114": (has_bzr114, "Canonical's Bazaar client >= 1.14"),
     "cvs": (has_cvs, "cvs client/server"),
     "darcs": (has_darcs, "darcs client"),
+    "docutils": (has_docutils, "Docutils text processing library"),
     "eol-in-paths": (has_eol_in_paths, "end-of-lines in paths"),
     "execbit": (has_executablebit, "executable bit"),
     "fifo": (has_fifo, "named pipes"),
@@ -198,7 +207,7 @@
     "outer-repo": (has_outer_repo, "outer repo"),
     "p4": (has_p4, "Perforce server and client"),
     "pygments": (has_pygments, "Pygments source highlighting library"),
-    "docutils": (has_docutils, "Docutils text processing library"),
+    "ssl": (has_ssl, "python ssl and openssl modules"),
     "svn": (has_svn, "subversion client and admin tools"),
     "svn-bindings": (has_svn_bindings, "subversion python bindings"),
     "symlink": (has_symlink, "symbolic links"),
@@ -272,5 +281,3 @@
 
     if failures != 0:
         sys.exit(1)
-
-