Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
51 lines (32 sloc) 1.33 KB

Regression tests for YAMLless operation

Job priorities are not preserved

Setup a connection that won't parse YAML:

>>> import beanstalkc
>>> beanstalk = beanstalkc.Connection(host='localhost', port=14711,
...                                   parse_yaml=False)

Observe that YAML is not parsed:

>>> isinstance(beanstalk.stats(), str)
True

Note that while Job#release and Job#bury will still work, they won't automatically maintain the released/buried Job's priority:

>>> jid = beanstalk.put('foo', priority=42)

>>> job = beanstalk.reserve()
>>> print repr(job.stats())                     # doctest: +ELLIPSIS
'...pri: 42...'

>>> job.release()               # Succeeds, but ...

>>> job = beanstalk.reserve()   # ... may not do what you want.
>>> print repr(job.stats())                     # doctest: +ELLIPSIS
'...pri: 2147483648...'

>>> job.delete()

Same for Job#bury:

>>> jid = beanstalk.put('bar', priority=42)

>>> job = beanstalk.reserve()
>>> print repr(job.stats())                     # doctest: +ELLIPSIS
'...pri: 42...'

>>> job.bury()

>>> print repr(beanstalk.stats_job(jid))        # doctest: +ELLIPSIS
'...pri: 2147483648...'

And that was that.

>>> beanstalk.close()
Jump to Line
Something went wrong with that request. Please try again.