سؤال

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?

هل كانت مفيدة؟

المحلول

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)
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top