Add abstract class gMainDC as an interface for gFBDC and gSDLDC
[vuplus_dvbapp] / tests / test_timer.py
index 17ac0fb..ea8b0bd 100644 (file)
@@ -7,19 +7,27 @@ import tests
 #enigma.reset()
 def test_timer(repeat = 0, timer_start = 3600, timer_length = 1000, sim_length = 86400 * 7):
 
-       print "loading RecordTimer"
-       import RecordTimer
-       print "ok"
+       import NavigationInstance
        
        at = time.time()
        
-       t = RecordTimer.RecordTimer()
+       t = NavigationInstance.instance.RecordTimer
+       print t
+       print "old mwt:", t.MaxWaitTime
        t.MaxWaitTime = 86400 * 1000
+       
+       # hack:
+       NavigationInstance.instance.SleepTimer.MaxWaitTime = 86400 * 1000
+
+       t.processed_timers = [ ]
+       t.timer_list = [ ]
+
 
        # generate a timer to test
-       import xml.dom.minidom
+       import xml.etree.cElementTree
+       import RecordTimer
 
-       timer = RecordTimer.createTimer(xml.dom.minidom.parseString(
+       timer = RecordTimer.createTimer(xml.etree.cElementTree.fromstring(
        """
                <timer 
                        begin="%d" 
@@ -33,7 +41,7 @@ def test_timer(repeat = 0, timer_start = 3600, timer_length = 1000, sim_length =
                        disabled="0" 
                        justplay="0">
        </timer>""" % (at + timer_start, at + timer_start + timer_length, repeat)
-       ).childNodes[0])
+       ))
 
        t.record(timer)
 
@@ -84,4 +92,5 @@ os.environ['TZ'] = 'CET'
 time.tzset()
 
 #log(test_timer, test_name = "test_timer_repeating", base_time = calendar.timegm((2007, 3, 1, 12, 0, 0)), repeat=0x7f, sim_length = 86400 * 7)
-log(test_timer, test_name = "test_timer_repeating_dst_start", base_time = calendar.timegm((2007, 03, 20, 0, 0, 0)), repeat=0x7f, sim_length = 86400 * 7)
+log(test_timer, test_name = "test_timer_repeating_dst_skip", base_time = calendar.timegm((2007, 03, 20, 0, 0, 0)), timer_start = 3600, repeat=0x7f, sim_length = 86400 * 7)
+#log(test_timer, test_name = "test_timer_repeating_dst_start", base_time = calendar.timegm((2007, 03, 20, 0, 0, 0)), timer_start = 10000, repeat=0x7f, sim_length = 86400 * 7)