def takeOwnership(self, host): """Sets the hosts for the owner. :type host: str :param host: the name of the host to take ownership of """ self.stub.TakeOwnership(host_pb2.OwnerTakeOwnershipRequest( owner=self.data, host=host), timeout=Cuebot.Timeout)
def testTakeOwnership(self, getStubMock): stubMock = mock.Mock() stubMock.TakeOwnership.return_value = host_pb2.OwnerTakeOwnershipResponse() getStubMock.return_value = stubMock owner = opencue.wrappers.owner.Owner( host_pb2.Owner(id=TEST_OWNER_ID, name=TEST_OWNER_NAME)) owner.takeOwnership(TEST_HOST_ID) stubMock.TakeOwnership.assert_called_with( host_pb2.OwnerTakeOwnershipRequest(owner=owner.data, host=TEST_HOST_ID), timeout=mock.ANY)
def takeOwnership(self, host): """Set the hosts new owner settings.""" self.stub.TakeOwnership(host_pb2.OwnerTakeOwnershipRequest(owner=self.data, host=host), timeout=Cuebot.Timeout)