Workaround bug 852095 without importing mox
* Fixes bug 912828 Change-Id: Iade4b0aca1d1f28ce46ed25d0b97c08d152554bd
This commit is contained in:
@@ -41,7 +41,6 @@ from eventlet import event
|
|||||||
from eventlet import greenthread
|
from eventlet import greenthread
|
||||||
from eventlet import semaphore
|
from eventlet import semaphore
|
||||||
from eventlet.green import subprocess
|
from eventlet.green import subprocess
|
||||||
import mox
|
|
||||||
import netaddr
|
import netaddr
|
||||||
|
|
||||||
from nova import exception
|
from nova import exception
|
||||||
@@ -690,10 +689,12 @@ def to_primitive(value, convert_instances=False, level=0):
|
|||||||
if test(value):
|
if test(value):
|
||||||
return unicode(value)
|
return unicode(value)
|
||||||
|
|
||||||
# NOTE(vish): Workaround for LP bug 852095. Without this workaround,
|
# FIXME(vish): Workaround for LP bug 852095. Without this workaround,
|
||||||
# tests that raise an exception in a mocked method that
|
# tests that raise an exception in a mocked method that
|
||||||
# has a @wrap_exception with a notifier will fail.
|
# has a @wrap_exception with a notifier will fail. If
|
||||||
if isinstance(value, mox.MockAnything):
|
# we up the dependency to 0.5.4 (when it is released) we
|
||||||
|
# can remove this workaround.
|
||||||
|
if getattr(value, '__module__', None) == 'mox':
|
||||||
return 'mock'
|
return 'mock'
|
||||||
|
|
||||||
if level > 3:
|
if level > 3:
|
||||||
|
|||||||
Reference in New Issue
Block a user