문제

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