Commits

Guido Draheim committed e906e6b

tests - four entries with nuke

  • Participants
  • Parent commits b2196ea

Comments (0)

Files changed (1)

src/tests/computer_test.py

   {  [23:33-00:33]+0 arte@0 (22 4 6) 'A2' }],
  [{  [00:10-01:10]+0 3sat@1 (23 4 0) 'A3' }]}"""
         self.assertEqual(E, unicode(res))
+    def test_40_4entries_samegroupandcontinue(self):
+        channellist = [Channel("nuke",0),Channel("arte",0)]
+        self.computer.set_adapters_from_channels_list(channellist)
+        self.assertTrue(u"1" not in self.computer.adapterlist())
+        a1 = Entry("arte","A1","22:30","23:30","0", "", "22.04.", "ok")
+        a2 = Entry("arte","A2","23:30","00:30","3", "", "22.04.", "ok")
+        a3 = Entry("arte","A3","00:30","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"""
+{[{  [22:30-23:30]+0 arte@0 (22 4 6) 'A1' },
+  {  [23:30-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.assertEqual(E, unicode(res))
+    def test_41_4entries_overlap1(self):
+        channellist = [Channel("nuke",0),Channel("arte",0)]
+        self.computer.set_adapters_from_channels_list(channellist)
+        self.assertTrue(u"1" not in self.computer.adapterlist())
+        a1 = Entry("nuke","A1","22:30","23:30","0", "", "22.04.", "ok")
+        a2 = Entry("arte","A2","23:20","00:30","3", "", "22.04.", "ok")
+        a3 = Entry("arte","A3","00:30","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"""
+{[{  [22:30-23:20]+0 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.assertEqual(E, unicode(res))
+    def test_42_4entries_overlap2(self):
+        channellist = [Channel("nuke",0),Channel("arte",0)]
+        self.computer.set_adapters_from_channels_list(channellist)
+        self.assertTrue(u"1" not in self.computer.adapterlist())
+        a1 = Entry("nuke","A1","22:30","00:40","0", "", "22.04.", "ok")
+        a2 = Entry("arte","A2","23:20","00:30","3", "", "22.04.", "ok")
+        a3 = Entry("arte","A3","00:30","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"""
+{[{  [22:30-23:20]+0 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.assertEqual(E, unicode(res))
+    def test_43_4entries_delete_start1(self): # FIXME zerotime -> delete
+        channellist = [Channel("nuke",0),Channel("arte",0)]
+        self.computer.set_adapters_from_channels_list(channellist)
+        self.assertTrue(u"1" not in self.computer.adapterlist())
+        a1 = Entry("nuke","A1","23:20","23:40","0", "", "22.04.", "ok")
+        a2 = Entry("arte","A2","23:20","00:30","3", "", "22.04.", "ok")
+        a3 = Entry("arte","A3","00:30","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-23:20]+0 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.assertEqual(E, unicode(res))
+    def test_44_4entries_delete_start2(self): # FIXME zerotime -> delete
+        channellist = [Channel("nuke",0),Channel("arte",0)]
+        self.computer.set_adapters_from_channels_list(channellist)
+        self.assertTrue(u"1" not in self.computer.adapterlist())
+        a1 = Entry("nuke","A1","23:20","00:40","0", "", "22.04.", "ok")
+        a2 = Entry("arte","A2","23:20","00:30","3", "", "22.04.", "ok")
+        a3 = Entry("arte","A3","00:30","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-23:20]+0 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.assertEqual(E, unicode(res))
+    def test_45_4entries_delete_inside1(self): # FIXME zerotime -> delete
+        channellist = [Channel("nuke",0),Channel("arte",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("arte","A3","00:30","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' },
+  {  [00:20-00:20]+0 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))
 
 if __name__ == "__main__":
     import sys