Beispiel #1
0
 def getSubscriptions(self):
     """Returns a list of all subscriptions
     @rtype: list<Subscription>
     @return: A list of subscription objects
     """
     response = self.stub.GetSubscriptions(show_pb2.ShowGetSubscriptionRequest(
         show=self.data),
         timeout=Cuebot.Timeout)
     subscriptionSeq = response.subscriptions
     return [opencue.wrappers.subscription.Subscription(subs) for subs in subscriptionSeq.subscriptions]
Beispiel #2
0
    def getSubscriptions(self):
        """Returns a list of all subscriptions the show has.

        :rtype:  list<opencue.wrappers.subscription.Subscription>
        :return: list of the show's subscriptions
        """
        response = self.stub.GetSubscriptions(
            show_pb2.ShowGetSubscriptionRequest(show=self.data), timeout=Cuebot.Timeout)
        subscriptionSeq = response.subscriptions
        return [opencue.wrappers.subscription.Subscription(subs)
                for subs in subscriptionSeq.subscriptions]
Beispiel #3
0
    def testGetSubscriptions(self, getStubMock):
        stubMock = mock.Mock()
        stubMock.GetSubscriptions.return_value = show_pb2.ShowGetSubscriptionResponse(
            subscriptions=subscription_pb2.SubscriptionSeq(
                subscriptions=[subscription_pb2.Subscription(name=TEST_SUBSCRIPTION_NAME)])
        )
        getStubMock.return_value = stubMock

        show = opencue.wrappers.show.Show(show_pb2.Show(name=TEST_SHOW_NAME))
        subscriptions = show.getSubscriptions()

        stubMock.GetSubscriptions.assert_called_with(
            show_pb2.ShowGetSubscriptionRequest(show=show.data), timeout=mock.ANY)
        self.assertEqual(len(subscriptions), 1)
        self.assertEqual(subscriptions[0].name(), TEST_SUBSCRIPTION_NAME)