From a35b2ccd6bcbbbd431d02a89f2bf247df1660159 Mon Sep 17 00:00:00 2001
From: Christophe Sovant <christophe.sovant@forgerock.com>
Date: Tue, 20 May 2008 09:51:57 +0000
Subject: [PATCH] Add 'create_property_table' function

---
 opends/tests/shared/python/common.py |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/opends/tests/shared/python/common.py b/opends/tests/shared/python/common.py
index 30f4861..535f5bd 100644
--- a/opends/tests/shared/python/common.py
+++ b/opends/tests/shared/python/common.py
@@ -35,6 +35,7 @@
             "report_generation", 
             "compare_file", 
             "is_windows_platform", 
+            "create_property_table", 
             "exception_thrown" ]
 
 class format_testcase:
@@ -192,3 +193,16 @@
       return Boolean.TRUE
     else:
       return Boolean.FALSE
+
+def create_property_table(output, separator):
+    table = {}
+
+    for line in output.splitlines():
+      key = line.split(separator)[0].strip()
+      try:
+        value = line.split(separator)[1].strip()
+      except IndexError:
+        value = '-'
+      table[key] = value
+
+    return table

--
Gitblit v1.10.0