diff options
author | Rafael H. Schloming <rhs@apache.org> | 2007-08-21 11:36:10 +0000 |
---|---|---|
committer | Rafael H. Schloming <rhs@apache.org> | 2007-08-21 11:36:10 +0000 |
commit | 955d5ccb544ff4f56d35c40aa8934cbf4dfff14e (patch) | |
tree | ed1226a12cb755fa9dc699c3cbc90237e6fa50fe | |
parent | 13a2fe60bdff9736f02b2976d6d58ffa9b8cb14d (diff) | |
download | qpid-python-955d5ccb544ff4f56d35c40aa8934cbf4dfff14e.tar.gz |
made codec.py load the spec file on demand
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@568074 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | python/tests/codec.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/python/tests/codec.py b/python/tests/codec.py index f9f7aab918..fbaf05fc20 100644 --- a/python/tests/codec.py +++ b/python/tests/codec.py @@ -54,7 +54,13 @@ __doc__ = """ """ -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 @@ class BaseDataTypes(unittest.TestCase): """ 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 @@ def test(type, value): else: values = [value] stream = StringIO() - codec = Codec(stream, SPEC) + codec = Codec(stream, spec()) for v in values: codec.encode(type, v) codec.flush() |