Exemple #1
0
    def createSubGroup(self, name):
        """Creates a subgroup under this group.

        :type  name: str
        :param name: name of the new subgroup
        """
        return Group(self.stub.CreateSubGroup(
            job_pb2.GroupCreateSubGroupRequest(group=self.data, name=name),
            timeout=Cuebot.Timeout).group)
Exemple #2
0
    def testCreateSubGroup(self, getStubMock):
        subgroupName = 'testSubgroup'
        stubMock = mock.Mock()
        stubMock.CreateSubGroup.return_value = job_pb2.GroupCreateSubGroupResponse(
            group=job_pb2.Group(name=subgroupName))
        getStubMock.return_value = stubMock

        group = opencue.wrappers.group.Group(
            job_pb2.Group(name=TEST_GROUP_NAME))
        subgroup = group.createSubGroup(subgroupName)

        stubMock.CreateSubGroup.assert_called_with(
            job_pb2.GroupCreateSubGroupRequest(group=group.data, name=subgroupName),
            timeout=mock.ANY)
        self.assertEqual(subgroup.name(), subgroupName)
Exemple #3
0
 def createSubGroup(self, name):
     return Group(
         self.stub.CreateSubGroup(job_pb2.GroupCreateSubGroupRequest(
             group=self.data, name=name),
                                  timeout=Cuebot.Timeout).group)
Exemple #4
0
 def createSubGroup(self, name):
     """Create a sub group"""
     return Group(
         self.stub.CreateSubGroup(job_pb2.GroupCreateSubGroupRequest(
             group=self.asGroup(), name=name),
                                  timeout=Cuebot.Timeout).group)