Beispiel #1
0
    def testFindSubscription(self, getStubMock):
        stubMock = mock.Mock()
        stubMock.Find.return_value = subscription_pb2.SubscriptionFindResponse(
            subscription=subscription_pb2.Subscription(name=TEST_SUB_NAME))
        getStubMock.return_value = stubMock

        sub = opencue.api.findSubscription(TEST_SUB_NAME)

        stubMock.Find.assert_called_with(
            subscription_pb2.SubscriptionFindRequest(name=TEST_SUB_NAME), timeout=mock.ANY)
        self.assertEqual(TEST_SUB_NAME, sub.name())
Beispiel #2
0
    def testFindSubscription(self, getStubMock):
        stubMock = mock.Mock()
        stubMock.Find.return_value = subscription_pb2.SubscriptionFindResponse(
            subscription=subscription_pb2.Subscription(name=TEST_SUBSCRIPTION_NAME))
        getStubMock.return_value = stubMock

        show = opencue.wrappers.show.Show(show_pb2.Show(name=TEST_SHOW_NAME))
        subscription = show.findSubscription(TEST_SUBSCRIPTION_NAME)

        stubMock.Find.assert_called_with(
            subscription_pb2.SubscriptionFindRequest(name=TEST_SUBSCRIPTION_NAME), timeout=mock.ANY)
        self.assertEqual(subscription.name(), TEST_SUBSCRIPTION_NAME)
Beispiel #3
0
    def testFind(self, getStubMock):
        stubMock = mock.Mock()
        stubMock.Find.return_value = subscription_pb2.SubscriptionFindResponse(
            subscription=subscription_pb2.Subscription(
                name=TEST_SUBSCRIPTION_NAME))
        getStubMock.return_value = stubMock

        expected = opencue.wrappers.subscription.Subscription(
            subscription_pb2.Subscription(name=TEST_SUBSCRIPTION_NAME))
        wrapper = opencue.wrappers.subscription.Subscription()
        subscription = wrapper.find(name=TEST_SUBSCRIPTION_NAME)

        stubMock.Find.assert_called_with(
            subscription_pb2.SubscriptionFindRequest(
                name=TEST_SUBSCRIPTION_NAME),
            timeout=mock.ANY)
        self.assertEqual(expected.name(), subscription.name())