Ejemplo n.º 1
0
class KalturaBaseTest(unittest.TestCase):
    """Base class for all Kaltura Tests"""

    #TODO  create a client factory as to avoid thrashing kaltura with logins...

    def setUp(self):
        #(client session is enough when we do operations in a users scope)
        self.config = GetConfig()
        self.client = KalturaClient(self.config)
        self.ks = self.client.generateSession(ADMIN_SECRET, USER_NAME,
                                              KalturaSessionType.ADMIN,
                                              PARTNER_ID, 86400, "")
        self.client.setKs(self.ks)

    def tearDown(self):

        #do cleanup first, probably relies on self.client
        self.doCleanups()

        del (self.ks)
        del (self.client)
        del (self.config)

    def readyWait(self, mediaId):
        """ Block until a 'ready' state is returned from server on the provided mediaId """
        sleeptime = 5
        while True:
            print "checking if media id %s is ready" % (mediaId, )
            mediaEntry = self.client.media.get(mediaId)
            if mediaEntry.getStatus().getValue() == '2':
                break
            else:
                time.sleep(sleeptime)
Ejemplo n.º 2
0
class KalturaBaseTest(unittest.TestCase):
    """Base class for all Kaltura Tests"""

    # TODO  create a client factory as to avoid thrashing kaltura with logins...

    def setUp(self):
        # (client session is enough when we do operations in a users scope)
        self.config = GetConfig()
        self.client = KalturaClient(self.config)
        self.ks = self.client.generateSession(ADMIN_SECRET, USER_NAME, KalturaSessionType.ADMIN, PARTNER_ID, 86400, "")
        self.client.setKs(self.ks)

    def tearDown(self):

        # do cleanup first, probably relies on self.client
        self.doCleanups()

        del (self.ks)
        del (self.client)
        del (self.config)

    def readyWait(self, mediaId):
        """ Block until a 'ready' state is returned from server on the provided mediaId """
        sleeptime = 5
        while True:
            print "checking if media id %s is ready" % (mediaId,)
            mediaEntry = self.client.media.get(mediaId)
            if mediaEntry.getStatus().getValue() == "2":
                break
            else:
                time.sleep(sleeptime)
Ejemplo n.º 3
0
class KalturaBaseTest(unittest.TestCase):
    """Base class for all Kaltura Tests"""

    # TODO  create a client factory as to avoid thrashing kaltura with logins...

    def setUp(self):
        # (client session is enough when we do operations in a users scope)
        self.config = GetConfig()
        self.client = KalturaClient(self.config)
        self.ks = self.client.generateSession(ADMIN_SECRET, USER_NAME, KalturaSessionType.ADMIN, PARTNER_ID, 86400, "")
        self.client.setKs(self.ks)

    def tearDown(self):

        # do cleanup first, probably relies on self.client
        self.doCleanups()

        del (self.ks)
        del (self.client)
        del (self.config)
class KalturaBaseTest(unittest.TestCase):
    """Base class for all Kaltura Tests"""

    #TODO  create a client factory as to avoid thrashing kaltura with logins...

    def setUp(self):
        #(client session is enough when we do operations in a users scope)
        self.config = GetConfig()
        self.client = KalturaClient(self.config)
        self.ks = self.client.generateSession(ADMIN_SECRET, USER_NAME,
                                              KalturaSessionType.ADMIN,
                                              PARTNER_ID, 86400, "")
        self.client.setKs(self.ks)

    def tearDown(self):

        #do cleanup first, probably relies on self.client
        self.doCleanups()

        del (self.ks)
        del (self.client)
        del (self.config)