Commits

Guido Draheim committed 2f8d6bb

add priority

Comments (0)

Files changed (1)

src/tests/computer_test.py

 import collections
 Channel = collections.namedtuple("Channel",["channelname", "adapter"])
 Entry = collections.namedtuple("Entry",["channelname","title",
-    "newtime","endtime", "extratime", "weekday", "onlydate", "status"])
+    "newtime","endtime", "extratime", "weekday", "onlydate", "status", "priority"])
 Locale = collections.namedtuple("Locale",["language"])
 Request = collections.namedtuple("Request",["locale"])
 
         self.assertEqual([u"1"], self.computer.adapters("3sat"))
         self.assertEqual([u"0", u"1"], self.computer.adapters("arte"))
     def test_03_entries(self):
-        a1 = Entry("arte","A1","22:30","23:30","0", "6", "", "ok")
+        a1 = Entry("arte","A1","22:30","23:30","0", "6", "", "ok",1)
         req = Request(Locale("de"))
         res = self.computer.plan4(req, [a1])
         self.logg.info("RESULT:%s", res)
 {[{  [22:30-23:30]+0 arte@0 (* 1,2,3,4,5,6,7,8,9,10,11,12 6) 'A1' }]}"""
         self.assertEqual(E, unicode(res))
     def test_04_entries(self):
-        a1 = Entry("arte","A1","22:30","23:30","0", "", "22.04.", "ok")
+        a1 = Entry("arte","A1","22:30","23:30","0", "", "22.04.", "ok",1)
         req = Request(Locale("de"))
         res = self.computer.plan4(req, [a1])
         self.logg.info("RESULT:%s", res)
 {[{  [22:30-23:30]+0 arte@0 (22 4 6) 'A1' }]}"""
         self.assertEqual(E, unicode(res))
     def test_10_2entries_samegroupandcontinue(self):
-        a1 = Entry("arte","A1","22:30","23:30","0", "", "22.04.", "ok")
-        a2 = Entry("arte","A2","23:30","00:30","0", "", "22.04.", "ok")
+        a1 = Entry("arte","A1","22:30","23:30","0", "", "22.04.", "ok",1)
+        a2 = Entry("arte","A2","23:30","00:30","0", "", "22.04.", "ok",1)
         req = Request(Locale("de"))
         res = self.computer.plan4(req, [a1, a2])
         self.logg.info("RESULT:%s", res)
   {  [23:30-00:30]+0 arte@0 (22 4 6) 'A2' }]}"""
         self.assertEqual(E, unicode(res))
     def test_11_2entries_differentgroups(self):
-        a1 = Entry("arte","A1","22:30","23:30","0", "", "22.04.", "ok")
-        a2 = Entry("arte","A2","23:33","00:33","0", "", "22.04.", "ok")
+        a1 = Entry("arte","A1","22:30","23:30","0", "", "22.04.", "ok",1)
+        a2 = Entry("arte","A2","23:33","00:33","0", "", "22.04.", "ok",1)
         req = Request(Locale("de"))
         res = self.computer.plan4(req, [a1, a2])
         self.logg.info("RESULT:%s", res)
         channellist = [Channel("3sat",0),Channel("arte",0), Channel("arte",1)]
         self.computer.set_adapters_from_channels_list(channellist)
         self.assertTrue(u"1" in self.computer.adapterlist())
-        a1 = Entry("arte","A1","22:30","23:30","0", "", "22.04.", "ok")
-        a2 = Entry("3sat","A2","22:33","23:33","0", "", "22.04.", "ok")
+        a1 = Entry("arte","A1","22:30","23:30","0", "", "22.04.", "ok",1)
+        a2 = Entry("3sat","A2","22:33","23:33","0", "", "22.04.", "ok",1)
         req = Request(Locale("de"))
         res = self.computer.plan4(req, [a1, a2])
         self.logg.info("RESULT:%s", res)
         channellist = [Channel("3sat",1),Channel("arte",0), Channel("arte",1)]
         self.computer.set_adapters_from_channels_list(channellist)
         self.assertTrue(u"1" in self.computer.adapterlist())
-        a1 = Entry("arte","A1","22:30","23:30","0", "", "22.04.", "ok")
-        a2 = Entry("3sat","A2","22:33","23:33","0", "", "22.04.", "ok")
+        a1 = Entry("arte","A1","22:30","23:30","0", "", "22.04.", "ok",1)
+        a2 = Entry("3sat","A2","22:33","23:33","0", "", "22.04.", "ok",1)
         req = Request(Locale("de"))
         res = self.computer.plan4(req, [a1, a2])
         self.logg.info("RESULT:%s", res)
         channellist = [Channel("3sat",0),Channel("arte",0), Channel("arte",1)]
         self.computer.set_adapters_from_channels_list(channellist)
         self.assertTrue(u"1" in self.computer.adapterlist())
-        a1 = Entry("arte","A1","22:30","23:30","0", "", "22.04.", "ok")
-        a2 = Entry("3sat","A2","22:33","23:33","0", "", "22.04.", "ok")
-        a3 = Entry("3sat","A3","23:33","00:33","0", "", "22.04.", "ok")
+        a1 = Entry("arte","A1","22:30","23:30","0", "", "22.04.", "ok",1)
+        a2 = Entry("3sat","A2","22:33","23:33","0", "", "22.04.", "ok",1)
+        a3 = Entry("3sat","A3","23:33","00:33","0", "", "22.04.", "ok",1)
         req = Request(Locale("de"))
         res = self.computer.plan4(req, [a1, a2, a3])
         self.logg.info("RESULT:%s", res)
         channellist = [Channel("3sat",1),Channel("arte",0), Channel("arte",1)]
         self.computer.set_adapters_from_channels_list(channellist)
         self.assertTrue(u"1" in self.computer.adapterlist())
-        a1 = Entry("arte","A1","22:30","23:30","0", "", "22.04.", "ok")
-        a2 = Entry("3sat","A2","22:33","23:33","0", "", "22.04.", "ok")
-        a3 = Entry("3sat","A3","23:33","00:33","0", "", "22.04.", "ok")
+        a1 = Entry("arte","A1","22:30","23:30","0", "", "22.04.", "ok",1)
+        a2 = Entry("3sat","A2","22:33","23:33","0", "", "22.04.", "ok",1)
+        a3 = Entry("3sat","A3","23:33","00:33","0", "", "22.04.", "ok",1)
         req = Request(Locale("de"))
         res = self.computer.plan4(req, [a1, a2, a3])
         self.logg.info("RESULT:%s", res)
         channellist = [Channel("3sat",1),Channel("arte",0), Channel("arte",1)]
         self.computer.set_adapters_from_channels_list(channellist)
         self.assertTrue(u"1" in self.computer.adapterlist())
-        a1 = Entry("3sat","A1","22:33","23:33","0", "", "22.04.", "ok")
-        a2 = Entry("arte","A2","23:30","00:30","0", "", "22.04.", "ok")
-        a3 = Entry("3sat","A3","23:33","00:33","0", "", "22.04.", "ok")
+        a1 = Entry("3sat","A1","22:33","23:33","0", "", "22.04.", "ok",1)
+        a2 = Entry("arte","A2","23:30","00:30","0", "", "22.04.", "ok",1)
+        a3 = Entry("3sat","A3","23:33","00:33","0", "", "22.04.", "ok",1)
         req = Request(Locale("de"))
         res = self.computer.plan4(req, [a1, a2, a3])
         self.logg.info("RESULT:%s", res)
         channellist = [Channel("3sat",1),Channel("arte",0), Channel("arte",1)]
         self.computer.set_adapters_from_channels_list(channellist)
         self.assertTrue(u"1" in self.computer.adapterlist())
-        a1 = Entry("arte","A1","22:33","23:33","0", "", "22.04.", "ok")
-        a2 = Entry("3sat","A2","23:30","00:30","0", "", "22.04.", "ok")
-        a3 = Entry("arte","A3","23:33","00:33","0", "", "22.04.", "ok")
+        a1 = Entry("arte","A1","22:33","23:33","0", "", "22.04.", "ok",1)
+        a2 = Entry("3sat","A2","23:30","00:30","0", "", "22.04.", "ok",1)
+        a3 = Entry("arte","A3","23:33","00:33","0", "", "22.04.", "ok",1)
         req = Request(Locale("de"))
         res = self.computer.plan4(req, [a1, a2, a3])
         self.logg.info("RESULT:%s", res)
         channellist = [Channel("3sat",1),Channel("arte",0), Channel("arte",1)]
         self.computer.set_adapters_from_channels_list(channellist)
         self.assertTrue(u"1" in self.computer.adapterlist())
-        a1 = Entry("arte","A1","22:33","23:33","0", "", "22.04.", "ok")
-        a2 = Entry("arte","A2","23:33","00:33","0", "", "22.04.", "ok")
-        a3 = Entry("3sat","A3","23:50","00:50","0", "", "22.04.", "ok")
+        a1 = Entry("arte","A1","22:33","23:33","0", "", "22.04.", "ok",1)
+        a2 = Entry("arte","A2","23:33","00:33","0", "", "22.04.", "ok",1)
+        a3 = Entry("3sat","A3","23:50","00:50","0", "", "22.04.", "ok",1)
         req = Request(Locale("de"))
         res = self.computer.plan4(req, [a1, a2, a3])
         self.logg.info("RESULT:%s", res)
         channellist = [Channel("3sat",1),Channel("arte",0), Channel("arte",1)]
         self.computer.set_adapters_from_channels_list(channellist)
         self.assertTrue(u"1" in self.computer.adapterlist())
-        a1 = Entry("arte","A1","22:33","23:33","0", "", "22.04.", "ok")
-        a2 = Entry("arte","A2","23:33","00:33","0", "", "22.04.", "ok")
-        a3 = Entry("3sat","A3","00:10","01:10","0", "", "23.04.", "ok")
+        a1 = Entry("arte","A1","22:33","23:33","0", "", "22.04.", "ok",1)
+        a2 = Entry("arte","A2","23:33","00:33","0", "", "22.04.", "ok",1)
+        a3 = Entry("3sat","A3","00:10","01:10","0", "", "23.04.", "ok",1)
         req = Request(Locale("de"))
         res = self.computer.plan4(req, [a1, a2, a3])
         self.logg.info("RESULT:%s", res)
         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")
+        a1 = Entry("arte","A1","22:30","23:30","0", "", "22.04.", "ok",1)
+        a2 = Entry("arte","A2","23:30","00:30","3", "", "22.04.", "ok",1)
+        a3 = Entry("arte","A3","00:30","01:10","3", "", "23.04.", "ok",1)
+        a4 = Entry("arte","A4","01:10","01:50","5", "", "23.04.", "ok",1)
         req = Request(Locale("de"))
         res = self.computer.plan4(req, [a1, a2, a3, a4])
         self.logg.info("RESULT:%s", res)
         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")
+        a1 = Entry("nuke","A1","22:30","23:30","0", "", "22.04.", "ok",1)
+        a2 = Entry("arte","A2","23:20","00:30","3", "", "22.04.", "ok",1)
+        a3 = Entry("arte","A3","00:30","01:10","3", "", "23.04.", "ok",1)
+        a4 = Entry("arte","A4","01:10","01:50","5", "", "23.04.", "ok",1)
         req = Request(Locale("de"))
         res = self.computer.plan4(req, [a1, a2, a3, a4])
         self.logg.info("RESULT:%s", res)
         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")
+        a1 = Entry("nuke","A1","22:30","00:40","0", "", "22.04.", "ok",1)
+        a2 = Entry("arte","A2","23:20","00:30","3", "", "22.04.", "ok",1)
+        a3 = Entry("arte","A3","00:30","01:10","3", "", "23.04.", "ok",1)
+        a4 = Entry("arte","A4","01:10","01:50","5", "", "23.04.", "ok",1)
         req = Request(Locale("de"))
         res = self.computer.plan4(req, [a1, a2, a3, a4])
         self.logg.info("RESULT:%s", res)
         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")
+        a1 = Entry("nuke","A1","23:20","23:40","0", "", "22.04.", "ok",1)
+        a2 = Entry("arte","A2","23:20","00:30","3", "", "22.04.", "ok",1)
+        a3 = Entry("arte","A3","00:30","01:10","3", "", "23.04.", "ok",1)
+        a4 = Entry("arte","A4","01:10","01:50","5", "", "23.04.", "ok",1)
         req = Request(Locale("de"))
         res = self.computer.plan4(req, [a1, a2, a3, a4])
         self.logg.info("RESULT:%s", res)
         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")
+        a1 = Entry("nuke","A1","23:20","00:40","0", "", "22.04.", "ok",1)
+        a2 = Entry("arte","A2","23:20","00:30","3", "", "22.04.", "ok",1)
+        a3 = Entry("arte","A3","00:30","01:10","3", "", "23.04.", "ok",1)
+        a4 = Entry("arte","A4","01:10","01:50","5", "", "23.04.", "ok",1)
         req = Request(Locale("de"))
         res = self.computer.plan4(req, [a1, a2, a3, a4])
         self.logg.info("RESULT:%s", res)
         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")
+        a1 = Entry("arte","A1","23:20","00:30","3", "", "22.04.", "ok",1)
+        a2 = Entry("nuke","A2","23:40","00:20","0", "", "22.04.", "ok",1)
+        a3 = Entry("arte","A3","00:30","01:10","3", "", "23.04.", "ok",1)
+        a4 = Entry("arte","A4","01:10","01:50","5", "", "23.04.", "ok",1)
         req = Request(Locale("de"))
         res = self.computer.plan4(req, [a1, a2, a3, a4])
         self.logg.info("RESULT:%s", res)
         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")
+        a1 = Entry("arte","A1","23:20","00:30","3", "", "22.04.", "ok",1)
+        a2 = Entry("nuke","A2","23:40","00:20","0", "", "22.04.", "ok",1)
+        a3 = Entry("3sat","A3","00:10","01:10","3", "", "23.04.", "ok",1)
+        a4 = Entry("arte","A4","01:10","01:50","5", "", "23.04.", "ok",1)
         req = Request(Locale("de"))
         res = self.computer.plan4(req, [a1, a2, a3, a4])
         self.logg.info("RESULT:%s", res)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.