Guido Draheim avatar Guido Draheim committed 0766502

test 2entries

Comments (0)

Files changed (1)

src/tests/computer_test.py

 import unittest
 
+import logging
+_logg = logging.getLogger("TESTS")
+if not _logg.handlers:
+    _logg.addHandler(logging.StreamHandler())
+    _logg.setLevel(logging.INFO)
+
 from dvbcronrecording.computer import DvbCronRecordingPlanComputer
-
 from trac.core import ComponentManager
 
 # fix this...
 
 class DvbComputerTests(unittest.TestCase):
     env = None
+    logg = _logg
     def setUp(self):
         if self.env is None:
             self.env = ComponentManager() 
     def test_03_entries(self):
         a = Entry("ard","ard1","22:30","23:30","0", "6", "", "ok")
         req = Request(Locale("de"))
-        print self.computer.plan4(req, [a])
+        res = self.computer.plan4(req, [a])
+        self.logg.info("\n%s", res)
+        E = u"{[{  [22:30-23:30]6@0 None([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]) 'ard1' }]}"
+        self.assertEqual(unicode(res), E)
     def test_04_entries(self):
         a = Entry("ard","ard1","22:30","23:30","0", "", "22.04.", "ok")
         req = Request(Locale("de"))
-        print self.computer.plan4(req, [a])
-
+        res = self.computer.plan4(req, [a])
+        self.logg.info("\n%s", res)
+        E = u"{[{  [22:30-23:30]6@0 22([4]) 'ard1' }]}"
+        self.assertEqual(unicode(res), E)
+    def test_10_2entries(self):
+        a = Entry("ard","ard1","22:30","23:30","0", "", "22.04.", "ok")
+        b = Entry("ard","ard1","23:30","00:30","0", "", "22.04.", "ok")
+        req = Request(Locale("de"))
+        res = self.computer.plan4(req, [a, b])
+        self.logg.info("\n%s", res)
+        E = u"{[{  [22:30-23:30]6@0 22([4]) 'ard1' },{  [23:30-00:30]6@0 22([4]) 'ard1' }]}"
+        self.assertEqual(unicode(res), E)
+    def test_11_2entries(self):
+        a = Entry("ard","ard1","22:30","23:30","0", "", "22.04.", "ok")
+        b = Entry("ard","ard1","23:33","00:33","0", "", "22.04.", "ok")
+        req = Request(Locale("de"))
+        res = self.computer.plan4(req, [a, b])
+        self.logg.info("\n%s", res)
+        E = u"{[{  [22:30-23:30]6@0 22([4]) 'ard1' }],[{  [23:33-00:33]6@0 22([4]) 'ard1' }]}"
+        self.assertEqual(unicode(res), E)
 
 if __name__ == "__main__":
     unittest.main()
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.