aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/enigma.py14
-rw-r--r--tests/events.py2
-rw-r--r--tests/test_timer.py19
3 files changed, 29 insertions, 6 deletions
diff --git a/tests/enigma.py b/tests/enigma.py
index c1f3bf6d..11c5b233 100644
--- a/tests/enigma.py
+++ b/tests/enigma.py
@@ -25,8 +25,10 @@ class eTimer:
def __init__(self):
self.timeout = slot()
self.next_activation = None
+ print "NEW TIMER"
def start(self, msec, singleshot = False):
+ print "start timer", msec
self.next_activation = time.time() + msec / 1000.0
self.msec = msec
self.singleshot = singleshot
@@ -49,6 +51,8 @@ def runIteration():
assert len(running_timers), "no running timers, so nothing will ever happen!"
running_timers.sort(key=lambda x: x.next_activation)
+ print "running:", running_timers
+
next_timer = running_timers[0]
now = time.time()
@@ -127,6 +131,9 @@ class pNavigation:
def playService(self, service):
return None
+ def __repr__(self):
+ return "pNavigation"
+
eRCInput = None
getPrevAsciiCode = None
@@ -276,7 +283,9 @@ eServiceCenter()
##################### ENIGMA CHROOT
+print "import directories"
import Tools.Directories
+print "done"
chroot="."
@@ -288,7 +297,9 @@ Tools.Directories.defaultPaths[Tools.Directories.SCOPE_CONFIG] = ("/etc/enigma2/
##################### ENIGMA CONFIG
+print "import config"
import Components.config
+print "done"
my_config = [
"config.skin.primary_skin=None\n"
@@ -306,14 +317,17 @@ class eActionMap:
##################### ENIGMA STARTUP:
def init_nav():
+ print "init nav"
import Navigation, NavigationInstance
NavigationInstance.instance = Navigation.Navigation()
def init_record_config():
+ print "init recording"
import Components.RecordingConfig
Components.RecordingConfig.InitRecordingConfig()
def init_parental_control():
+ print "init parental"
from Components.ParentalControl import InitParentalControl
InitParentalControl()
diff --git a/tests/events.py b/tests/events.py
index 83d7f2b8..dde84e26 100644
--- a/tests/events.py
+++ b/tests/events.py
@@ -45,7 +45,7 @@ def end_log(test_name):
f.write(results)
f.close()
- print expected, results
+ print results
if expected is not None:
print "expected:"
diff --git a/tests/test_timer.py b/tests/test_timer.py
index 17ac0fb1..565a838b 100644
--- a/tests/test_timer.py
+++ b/tests/test_timer.py
@@ -7,17 +7,25 @@ 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 RecordTimer
timer = RecordTimer.createTimer(xml.dom.minidom.parseString(
"""
@@ -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)