Commits

Guido Draheim committed 43c3a2f

more deleted items tests

  • Participants
  • Parent commits 6006135

Comments (0)

Files changed (2)

File src/dvbcronrecording/computer.py

     def __unicode__(self):
         months = u",".join([unicode(month) for month in self.months])
         x = u"{ "
-        x += u" [%s-%s]+%s" % (MMMtoHHMM(self.newtimeMMM), MMMtoHHMM(self.endtimeMMM), self.extratimeM)
+        if self.newtimeMMM == self.endtimeMMM and not self.extratimeM:
+            x += u" [--DELETED--]  "
+        else:
+            x += u" [%s-%s]+%s" % (MMMtoHHMM(self.newtimeMMM), MMMtoHHMM(self.endtimeMMM), self.extratimeM)
         x += u" %s@%s" % (self.channelname, ustar(self.adapter))
         x += u" (%s %s %s)" % (ustar(self.onlyday), ustar(months), ustar(self.weekday))
         x += u" '%s'" % (unicode(self.title))
-        if self.newtimeMMM == self.endtimeMMM and not self.extratimeM:
-            x += u" [DEL]"
         x += u" }"
         return x
     def __str__(self):

File src/tests/computer_test.py

         res = self.computer.plan4(req, [a1, a2, a3, a4])
         self.logg.info("RESULT:%s", res)
         E = u"""
-{[{  [23:20-23:20]+0 nuke@0 (22 4 6) 'A1' [DEL] },
+{[{  [--DELETED--]   nuke@0 (22 4 6) 'A1' },
   {  [23:20-00:30]+3 arte@0 (22 4 6) 'A2' },
   {  [00:33-01:10]+3 arte@0 (23 4 0) 'A3' },
   {  [01:13-01:50]+5 arte@0 (23 4 0) 'A4' }]}"""
         res = self.computer.plan4(req, [a1, a2, a3, a4])
         self.logg.info("RESULT:%s", res)
         E = u"""
-{[{  [23:20-23:20]+0 nuke@0 (22 4 6) 'A1' [DEL] },
+{[{  [--DELETED--]   nuke@0 (22 4 6) 'A1' },
   {  [23:20-00:30]+3 arte@0 (22 4 6) 'A2' },
   {  [00:33-01:10]+3 arte@0 (23 4 0) 'A3' },
   {  [01:13-01:50]+5 arte@0 (23 4 0) 'A4' }]}"""
         self.logg.info("RESULT:%s", res)
         E = u"""
 {[{  [23:20-00:30]+3 arte@0 (22 4 6) 'A1' },
-  {  [00:20-00:20]+0 nuke@0 (23 4 0) 'A2' [DEL] },
+  {  [--DELETED--]   nuke@0 (23 4 0) 'A2' },
   {  [00:33-01:10]+3 arte@0 (23 4 0) 'A3' },
   {  [01:13-01:50]+5 arte@0 (23 4 0) 'A4' }]}"""
         self.assertEqual(E, unicode(res))
+    def test_45_4entries_delete2_inside1(self): # FIXME zerotime -> delete
+        channellist = [Channel("nuke",0),Channel("arte",0),Channel("3sat",0)]
+        self.computer.set_adapters_from_channels_list(channellist)
+        self.assertTrue(u"1" not in self.computer.adapterlist())
+        a1 = Entry("arte","A1","23:20","00:30","3", "", "22.04.", "ok")
+        a2 = Entry("nuke","A2","23:40","00:20","0", "", "22.04.", "ok")
+        a3 = Entry("3sat","A3","00:10","01:10","3", "", "23.04.", "ok")
+        a4 = Entry("arte","A4","01:10","01:50","5", "", "23.04.", "ok")
+        req = Request(Locale("de"))
+        res = self.computer.plan4(req, [a1, a2, a3, a4])
+        self.logg.info("RESULT:%s", res)
+        E = u"""
+{[{  [23:20-00:30]+3 arte@0 (22 4 6) 'A1' },
+  {  [--DELETED--]   nuke@0 (23 4 0) 'A2' },
+  {  [00:33-01:10]+3 3sat@0 (23 4 0) 'A3' },
+  {  [01:13-01:50]+5 arte@0 (23 4 0) 'A4' }]}"""
+        self.assertEqual(E, unicode(res))
 
 if __name__ == "__main__":
     import sys