summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2007-03-26 16:45:10 (GMT)
committerFelix Domke <tmbinc@elitedvb.net>2007-03-26 16:45:10 (GMT)
commitd8564ebece1acf3d713aefbbf8750d6bf578153b (patch)
treed4ef61a23f1cc8504aeeee9d8306870ee71fd930 /tests
parent359c587f3be20090ac84b152abde2886a391a55d (diff)
add test_timer_repeating_dst_start test (disable the other one for now)
Diffstat (limited to 'tests')
-rw-r--r--tests/test_timer.py24
1 files changed, 16 insertions, 8 deletions
diff --git a/tests/test_timer.py b/tests/test_timer.py
index 2ee76f1..17ac0fb 100644
--- a/tests/test_timer.py
+++ b/tests/test_timer.py
@@ -2,13 +2,19 @@ import enigma
import sys
import time
+import tests
+
#enigma.reset()
-def test_timer(repeat = 0, timer_start = 10, timer_length = 100):
+def test_timer(repeat = 0, timer_start = 3600, timer_length = 1000, sim_length = 86400 * 7):
+
+ print "loading RecordTimer"
import RecordTimer
+ print "ok"
at = time.time()
t = RecordTimer.RecordTimer()
+ t.MaxWaitTime = 86400 * 1000
# generate a timer to test
import xml.dom.minidom
@@ -32,7 +38,7 @@ def test_timer(repeat = 0, timer_start = 10, timer_length = 100):
t.record(timer)
# run virtual environment
- enigma.run(4 * 86400)
+ enigma.run(sim_length)
print "done."
@@ -54,7 +60,12 @@ def test_timer(repeat = 0, timer_start = 10, timer_length = 100):
print t_initial
print t_repeated
-# assert t_initial[3:6] == t_repeated[3:6], "repeated timer time of day does not match"
+ if t_initial[3:6] != t_repeated[3:6]:
+ raise tests.TestError("repeated timer time of day does not match")
+
+import FakeNotifications
+#sys.modules["Tools.Notifications"] = FakeNotifications
+#sys.modules["Tools.NumericalTextInput.NumericalTextInput"] = FakeNotifications
# required stuff for timer (we try to keep this minimal)
enigma.init_nav()
@@ -62,9 +73,6 @@ enigma.init_record_config()
enigma.init_parental_control()
-import FakeNotifications
-sys.modules["Notifications"] = FakeNotifications
-
from events import log
import calendar
@@ -75,5 +83,5 @@ import os
os.environ['TZ'] = 'CET'
time.tzset()
-log(test_timer, base_time = calendar.timegm((2007, 3, 24, 12, 0, 0)), repeat=0x7f)
-#log(test_timer, base_time = calendar.timegm((2007, 03, 20, 0, 0, 0)), repeat=0x7f)
+#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)