selftest.socket_wrapper: Add docstrings.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 4 Mar 2012 00:36:01 +0000 (01:36 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 4 Mar 2012 17:02:06 +0000 (18:02 +0100)
selftest/socket_wrapper.py

index a456452..78e90e0 100644 (file)
@@ -21,6 +21,13 @@ import os
 import shutil
 
 def setup_dir(dir, pcap):
+    """Setup a socket wrapper directory.
+
+    :param dir: Socket wrapper directory (None if socket wrapper should be
+        disabled)
+    :param pcap: Whether to generate pcap files
+    :return: The socket wrapper directory
+    """
     pcap_dir = None
 
     if dir is not None:
@@ -28,7 +35,7 @@ def setup_dir(dir, pcap):
             shutil.rmtree(dir)
         os.mkdir(dir, 0777)
 
-        if pcap is not None:
+        if pcap:
             pcap_dir = os.path.join(dir, "pcap")
 
             if os.path.isdir(pcap_dir):