def test_repr_002_01(self):
        """
        Test '__repr__' and '__str__' methods from dataheap.py
        """

        chanid = self.testenv['RECCHANID']
        starttimemyth = self.testenv['RECSTARTTIMEMYTH']
        title = self.testenv['RECTITLE']

        c_s = (chanid, starttimemyth)

        db = MythDB()
        # Recorded class
        r = Recorded(c_s, db=db)
        print()
        print(repr(r))
        print(str(r))

        # Markup table
        m = r.markup
        print()
        print(repr(m))
        print(str(m))
        # one entry of the marlup table:
        print()
        print(repr(m[0]))
        print(str(m[0]))
        # one value of a single entry:
        print()
        print(repr(m[0].mark))
        print(str(m[0].mark))
        print()
        print(repr(m[0].data))
        print(str(m[0].data))

        # Artwork
        a = r.artwork
        print()
        print(repr(a))
        print(str(a))

        # Coverart of an Artwork
        ac = a.coverart
        print()
        print(repr(ac))
        print(str(ac))

        # Program of the recorded entry:
        prgrm = r.getRecordedProgram()
        print()
        print(repr(prgrm))
        print(str(prgrm))

        # OldRecorded of the recorded entry:
        oldrecs = db.searchOldRecorded(chanid=chanid, title=title)
        oldrec = next(oldrecs)
        print()
        print(repr(oldrec))
        print(str(oldrec))
Exemple #2
0
    def test_Dataheap_Recorded_001_03(self):
        """Test method 'getRecordedProgram()' in class 'Recorded' from 'dataheap'.
        """
        chanid        = self.testenv['RECCHANID']
        starttimeutc  = self.testenv['RECSTARTTIMEUTC']
        starttimemyth = self.testenv['RECSTARTTIMEMYTH']
        title         = self.testenv['RECTITLE']
        basename      = self.testenv['RECBASENAME']
        recordedid    = self.testenv['RECRECORDID']
        inetref       = self.testenv['RECINETREF']

        rec = Recorded((chanid, starttimemyth), db = self.mydb)
        prgrm = rec.getRecordedProgram()
        self.assertEqual(prgrm.chanid, int(chanid))