コード例 #1
0
    def test_create(self):

        shot = Shot()
        shot.code = "delete me again - " + str(uuid.uuid1())
        shot.project = self.testproject
        shot.save()
        newshotid = shot.getLocalID()
        self.assertTrue(newshotid != None
                        and newshotid != shotgun_replica.UNKNOWN_SHOTGUN_ID)

        shot_ret = getObject("Shot", local_id=newshotid)
        self.assertTrue(shot_ret != None)
        self.assertTrue(shot_ret.getSgObj() == None)

        allOk = self.local2shotgun.connectAndRun()
        self.assertTrue(allOk, "errors while syncing ")

        shot_ret = getObject("Shot", local_id=newshotid)
        newRemoteID = shot_ret.getRemoteID()
        self.assertTrue(
            newRemoteID != None
            and newRemoteID != shotgun_replica.UNKNOWN_SHOTGUN_ID,
            "Shot with local ID %d has no remote id %s" %
            (newshotid, newRemoteID))
        self.assertTrue(shot_ret.getSgObj() != None)

        entity_manipulation.deleteEntity(shot_ret)

        shot_ret = getObject("Shot", local_id=newshotid)

        self.assertTrue(shot_ret == None)

        newshot = self.sg.find("Shot",
                               filters=[['id', 'is', newRemoteID]],
                               fields=['id'],
                               filter_operator='all',
                               limit=100)
        self.assertEqual(len(newshot), 1)
        allOk = self.local2shotgun.connectAndRun()
        self.assertTrue(allOk, "errors while syncing ")

        newshot = self.sg.find("Shot",
                               filters=[['id', 'is', newRemoteID]],
                               fields=['id'],
                               filter_operator='all',
                               limit=100)
        self.assertEqual(len(newshot), 0)
コード例 #2
0
    def test_create(self):

        shot = Shot()
        shot.code = "delete me again - " + str(uuid.uuid1())
        shot.project = self.testproject
        shot.save()
        newshotid = shot.getLocalID()
        self.assertTrue(self.eventprocessor.connectAndRun(),
                        "synch not successful")

        shot_ret = getObject("Shot", local_id=newshotid)

        newRemoteID = shot_ret.getRemoteID()

        self.assertTrue(newRemoteID != None
                        and newRemoteID != shotgun_replica.UNKNOWN_SHOTGUN_ID)

        newCutIn = 1234
        shot_ret.sg_cut_in = newCutIn
        shot_ret.save()
        self.assertTrue(self.eventprocessor.connectAndRun(),
                        "synch not successful")

        newshot = self.sg.find("Shot",
                               filters=[['id', 'is', newRemoteID]],
                               fields=['id', 'sg_cut_in'],
                               filter_operator='all',
                               limit=100)

        self.assertEqual(newshot[0]['sg_cut_in'], newCutIn)

        shot_ret = shot_ret.delete()

        self.assertEqual(shot_ret, None)
        isShot = getObject("Shot", local_id=newshotid)
        self.assertEqual(isShot, None)

        self.assertTrue(self.eventprocessor.connectAndRun(),
                        "synch not successful")

        newshot = self.sg.find("Shot",
                               filters=[['id', 'is', newRemoteID]],
                               fields=['id', 'sg_cut_in'],
                               filter_operator='all',
                               limit=100)
        self.assertEqual(len(newshot), 0)
コード例 #3
0
    def test_create( self ):

        shot = Shot()
        shot.code = "delete me again - " + str( uuid.uuid1() )
        shot.project = self.testproject
        shot.save()
        newshotid = shot.getLocalID()
        self.assertTrue( newshotid != None and newshotid != shotgun_replica.UNKNOWN_SHOTGUN_ID )

        shot_ret = getObject( "Shot", local_id = newshotid )
        self.assertTrue( shot_ret != None )
        self.assertTrue( shot_ret.getSgObj() == None )

        allOk = self.local2shotgun.connectAndRun()
        self.assertTrue( allOk, "errors while syncing " )

        shot_ret = getObject( "Shot", local_id = newshotid )
        newRemoteID = shot_ret.getRemoteID()
        self.assertTrue( newRemoteID != None and newRemoteID != shotgun_replica.UNKNOWN_SHOTGUN_ID,
                         "Shot with local ID %d has no remote id %s" % ( newshotid, newRemoteID ) )
        self.assertTrue( shot_ret.getSgObj() != None )

        entity_manipulation.deleteEntity( shot_ret )

        shot_ret = getObject( "Shot", local_id = newshotid )

        self.assertTrue( shot_ret == None )

        newshot = self.sg.find( 
                               "Shot",
                               filters = [['id', 'is', newRemoteID]],
                               fields = ['id'],
                               filter_operator = 'all',
                               limit = 100
                               )
        self.assertEqual( len( newshot ), 1 )
        allOk = self.local2shotgun.connectAndRun()
        self.assertTrue( allOk, "errors while syncing " )

        newshot = self.sg.find( 
                               "Shot",
                               filters = [['id', 'is', newRemoteID]],
                               fields = ['id'],
                               filter_operator = 'all',
                               limit = 100
                               )
        self.assertEqual( len( newshot ), 0 )
コード例 #4
0
    def test_create( self ):

        shot = Shot()
        shot.code = "delete me again - " + str( uuid.uuid1() )
        shot.project = self.testproject
        shot.save()
        newshotid = shot.getLocalID()
        self.assertTrue( self.eventprocessor.connectAndRun(), "synch not successful" )

        shot_ret = getObject( "Shot", local_id = newshotid )

        newRemoteID = shot_ret.getRemoteID()

        self.assertTrue( newRemoteID != None and newRemoteID != shotgun_replica.UNKNOWN_SHOTGUN_ID )

        newCutIn = 1234
        shot_ret.sg_cut_in = newCutIn
        shot_ret.save()
        self.assertTrue( self.eventprocessor.connectAndRun(), "synch not successful" )

        newshot = self.sg.find( 
                               "Shot",
                               filters = [['id', 'is', newRemoteID]],
                               fields = ['id', 'sg_cut_in'],
                               filter_operator = 'all',
                               limit = 100
                               )

        self.assertEqual( newshot[0]['sg_cut_in'], newCutIn )

        shot_ret = shot_ret.delete()

        self.assertEqual( shot_ret, None )
        isShot = getObject( "Shot", local_id = newshotid )
        self.assertEqual( isShot, None )

        self.assertTrue( self.eventprocessor.connectAndRun(), "synch not successful" )

        newshot = self.sg.find( 
                               "Shot",
                               filters = [['id', 'is', newRemoteID]],
                               fields = ['id', 'sg_cut_in'],
                               filter_operator = 'all',
                               limit = 100
                               )
        self.assertEqual( len( newshot ), 0 )