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 | 87731c6669fd153ba20e889f32da9283b945fa90 (patch) | |
| tree | f1ad80891a193b6e827e7fcd82bd95e2a67b63d9 /qpid/python | |
| parent | 2892baeed6c304f7beb4583ad4b29785f2f6dd42 (diff) | |
| download | qpid-python-87731c6669fd153ba20e889f32da9283b945fa90.tar.gz | |
made codec.py load the spec file on demand
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@568074 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python')
| -rw-r--r-- | qpid/python/tests/codec.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/qpid/python/tests/codec.py b/qpid/python/tests/codec.py index f9f7aab918..fbaf05fc20 100644 --- a/qpid/python/tests/codec.py +++ b/qpid/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() |
