Пример #1
0
def createShow(show):
    """Creates a new show.

     :type  show: str
     :param show: a new show name to create
     :rtype:  Show
     :return: the created show object"""
    return Show(Cuebot.getStub('show').CreateShow(
        show_pb2.ShowCreateShowRequest(name=show), timeout=Cuebot.Timeout).show)
Пример #2
0
    def testCreateShow(self, getStubMock):
        stubMock = mock.Mock()
        stubMock.CreateShow.return_value = show_pb2.ShowCreateShowResponse(
            show=show_pb2.Show(name=TEST_SHOW_NAME))
        getStubMock.return_value = stubMock

        newShow = opencue.api.createShow(TEST_SHOW_NAME)

        stubMock.CreateShow.assert_called_with(
            show_pb2.ShowCreateShowRequest(name=TEST_SHOW_NAME), timeout=mock.ANY)
        self.assertEqual(TEST_SHOW_NAME, newShow.name())