Pregunta

When I was looking at the source code for capability_stub.py in app engine's testbed framework, I saw a comment stating that every service was always enabled. Now, is there a way to simmulate certain outages by disabling certain services, other than writing my own stub?

¿Fue útil?

Solución

testbed = testbed.Testbed()
testbed.activate()
testbed.init_capability_stub()
stub = testbed.get_stub('capability_service')
stub.SetPackageEnabled('memcache', False)
from google.appengine.api import capabilities
assert(capabilities.CapabilitySet('memcache').is_enabled() == False)
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top