knipknap/SpiffWorkflow — pull request #26 by jplana (2013-05-17 21:01:38+00:00)
Title: Fix celery tests

Hi again!

I found these two exceptions:

```
=================================================================
ERROR: testSerializationWithoutKwargs (specs.CeleryTest.CeleryTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/jplana/Code/SelfServiceHotfixService/SpiffWorkflow/tests/SpiffWorkflow/specs/CeleryTest.py", line 37, in testSerializationWithoutKwargs
data = nokw.serialize(serializer)
File "/Users/jplana/Code/SelfServiceHotfixService/SpiffWorkflow/tests/SpiffWorkflow/../../SpiffWorkflow/specs/Celery.py", line 252, in serialize
return serializer._serialize_celery(self)
File "/Users/jplana/Code/SelfServiceHotfixService/SpiffWorkflow/tests/SpiffWorkflow/../../SpiffWorkflow/storage/DictionarySerializer.py", line 175, in _serialize_celery
args = self._serialize_list(spec.args)
File "/Users/jplana/Code/SelfServiceHotfixService/SpiffWorkflow/tests/SpiffWorkflow/../../SpiffWorkflow/storage/DictionarySerializer.py", line 34, in _serialize_list
return [(k, b64encode(marshal.dumps(v))) for k, v in thedict]
TypeError: 'Attrib' object is not iterable
````

and, after fixing the problem:

```
=================================================================
ERROR: testSerialize (specs.CeleryTest.CeleryTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/jplana/Code/SelfServiceHotfixService/SpiffWorkflow/tests/SpiffWorkflow/specs/TaskSpecTest.py", line 76, in testSerialize
serialized = spec.serialize(serializer)
File "/Users/jplana/Code/SelfServiceHotfixService/SpiffWorkflow/tests/SpiffWorkflow/../../SpiffWorkflow/specs/Celery.py", line 252, in serialize
return serializer._serialize_celery(self)
File "/Users/jplana/Code/SelfServiceHotfixService/SpiffWorkflow/tests/SpiffWorkflow/../../SpiffWorkflow/storage/DictionarySerializer.py", line 175, in _serialize_celery
args = self._serialize_list(spec.args)
File "/Users/jplana/Code/SelfServiceHotfixService/SpiffWorkflow/tests/SpiffWorkflow/../../SpiffWorkflow/storage/DictionarySerializer.py", line 34, in _serialize_list
return [b64encode(marshal.dumps(v)) for v in thelist]
ValueError: unmarshallable object

----------------------------------------------------------------------
````
So I changed all marshalls to pickles (which I think is better anyway for serialization/storage), and changed the celery dictionary serialization.
I've checked that the unittests passes when celery is installed. It seems that these tests are only executed when celery is installed, so they're easy to miss. These will fix these two small bugs.