+ if "invalid token" not in failure.getErrorMessage():
+ return failure
+ login = self._login()
+ login.addCallback(lambda unused: call())
Looks nice.
[3]
+ failure.trap(Fault)
+ if "invalid token" not in failure.getErrorMessage():
+ return failure
None of that logic is covered by tests, though.
[4]
+ def check(actual):
+ if actual != expect:
+ raise ProviderError(
+ "Bad result from call to %s with %s (got %r, expected %r)"
+ % (name, args, actual, expect))
+ return actual
Looks nice. Just a few minors, and +1.
[1]
+ @property class(self) : "acquired- mgmt-class" ] class(self) : "available- mgmt-class" ] config[ "orchestra- user"], "orchestra- pass"])
+ def _acquired_
+ return self._config[
+
+ @property
+ def _available_
+ return self._config[
+
+ @property
+ def _credentials(self):
+ return (self._
+ self._config[
Not a big deal, but just as some feedback, this feels like
adding more complexity than necessary for the problem at
hand. Compare with this version:
self._ acquired_ class = self._config[ "acquired- mgmt-class" ] available_ class = self._config[ "available- mgmt-class" ] "orchestra- user"] "orchestra- pass"]
self._
self._user = self._config[
self._pass = self._config[
[2]
+ if "invalid token" not in failure. getErrorMessage (): ck(lambda unused: call())
+ return failure
+ login = self._login()
+ login.addCallba
Looks nice.
[3]
+ failure.trap(Fault) getErrorMessage ():
+ if "invalid token" not in failure.
+ return failure
None of that logic is covered by tests, though.
[4]
+ def check(actual):
+ if actual != expect:
+ raise ProviderError(
+ "Bad result from call to %s with %s (got %r, expected %r)"
+ % (name, args, actual, expect))
+ return actual
Also untouched by tests.
[5]
+ self.mock_proxy() get_systems( ) acquire_ system( ) set_ks_ meta() start_system( )
+ self.mock_
+ self.mock_
+ self.mock_
+ self.mock_
I guess there's no better way to test that interaction with the external system,
but I have to say I'm a bit sad about the amount of mocking here.