def findShow(name): """Returns a list of show objects. :type name: str :param name: a string that represents a show to return :rtype: Show :return: the matching Show object""" return Show(Cuebot.getStub('show').FindShow( show_pb2.ShowFindShowRequest(name=name), timeout=Cuebot.Timeout).show)
def findShow(name): """Returns a list of show objects. @type name: str @param name: a string that represents a show to return @rtype: Show @return: a List of show objects""" return Show( Cuebot.getStub('show').FindShow( show_pb2.ShowFindShowRequest(name=name), timeout=Cuebot.Timeout).show)
def findFilter(self, name): """Find the filter by name @type: string @param: name of filter to find @rtype: Filter @return: filter wrapper of found filter """ response = self.stub.FindFilter(show_pb2.ShowFindShowRequest( show=self.data, name=name), timeout=Cuebot.Timeout) return filter.Filter(response.filter)
def testFindShow(self, getStubMock): stubMock = mock.Mock() stubMock.FindShow.return_value = show_pb2.ShowFindShowResponse( show=show_pb2.Show(name=TEST_SHOW_NAME)) getStubMock.return_value = stubMock show = opencue.api.findShow(TEST_SHOW_NAME) stubMock.FindShow.assert_called_with( show_pb2.ShowFindShowRequest(name=TEST_SHOW_NAME), timeout=mock.ANY) self.assertEqual(TEST_SHOW_NAME, show.name())