Author: rhs
Date: Tue Aug 21 04:36:10 2007
New Revision: 568074

URL: http://svn.apache.org/viewvc?rev=568074&view=rev
Log:
made codec.py load the spec file on demand

Modified:
    incubator/qpid/trunk/qpid/python/tests/codec.py

Modified: incubator/qpid/trunk/qpid/python/tests/codec.py
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/tests/codec.py?rev=568074&r1=568073&r2=568074&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/tests/codec.py (original)
+++ incubator/qpid/trunk/qpid/python/tests/codec.py Tue Aug 21 04:36:10 2007
@@ -54,7 +54,13 @@
 
 """
 
-SPEC = load(testrunner.get_spec_file("amqp.0-10-preview.xml"))
+SPEC = None
+
+def spec():
+    global SPEC
+    if SPEC == None:
+        SPEC = load(testrunner.get_spec_file("amqp.0-10-preview.xml"))
+    return SPEC
 
 # --------------------------------------
 # --------------------------------------
@@ -70,7 +76,7 @@
         """
         standard setUp for unitetest (refer unittest documentation for details)
         """
-        self.codec = Codec(StringIO(), SPEC)
+        self.codec = Codec(StringIO(), spec())
 
     # ------------------
     def tearDown(self):
@@ -508,7 +514,7 @@
     else:
       values = [value]
     stream = StringIO()
-    codec = Codec(stream, SPEC)
+    codec = Codec(stream, spec())
     for v in values:
       codec.encode(type, v)
     codec.flush()


Reply via email to