add some more hacks, add test timer
authorFelix Domke <tmbinc@elitedvb.net>
Mon, 26 Mar 2007 00:40:43 +0000 (00:40 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Mon, 26 Mar 2007 00:40:43 +0000 (00:40 +0000)
tests/enigma.py
tests/test_timer.py

index 9c700ae..97fcdb9 100644 (file)
@@ -66,8 +66,8 @@ stopped = False
 
 def stop():
        global stopped
-#      print "STOP NOW"
-#      stopped = True
+       print "STOP NOW"
+       stopped = True
 
 def run():
        stoptimer = eTimer()
@@ -90,6 +90,48 @@ loadPNG = None
 addFont = None
 gRGB = None
 eWindowStyleSkinned = None
+eButton = None
+eListboxPythonStringContent = None
+eListbox = None
+eEPGCache = None
+getBestPlayableServiceReference = None
+
+class eServiceReference:
+
+       isDirectory=1
+       mustDescent=2
+       canDescent=4
+       flagDirectory=isDirectory|mustDescent|canDescent
+       shouldSort=8
+       hasSortKey=16
+       sort1=32
+       isMarker=64
+       isGroup=128
+
+       def __init__(self, ref):
+               self.ref = ref
+               self.flags = 0
+
+iRecordableService = None
+quitMainloop = None
+eAVSwitch = None
+eDVBVolumecontrol = None
+eDBoxLCD = None
+
+class eServiceCenter:
+       @classmethod
+       def getInstance(self):
+               return self.instance
+
+       instance = None
+
+       def __init__(self):
+               eServiceCenter.instance = self
+
+       def info(self, ref):
+               return None
+
+eServiceCenter()
 
 ##################### ENIGMA CONFIG
 
@@ -101,3 +143,21 @@ my_config = [
 
 Components.config.config.unpickle(my_config)
 
+##################### ENIGMA CHROOT
+
+import Tools.Directories
+
+chroot="."
+
+for (x, (y, z)) in Tools.Directories.defaultPaths.items():
+       Tools.Directories.defaultPaths[x] = (chroot + y, z)
+
+Tools.Directories.defaultPaths[Tools.Directories.SCOPE_SKIN] = ("../data/", Tools.Directories.PATH_DONTCREATE)
+
+##################### ENIGMA ACTIONS
+
+class eActionMap:
+       def __init__(self):
+               pass
+
+
index e1672e7..4745030 100644 (file)
@@ -4,6 +4,25 @@ import RecordTimer
 
 t = RecordTimer.RecordTimer()
 
+# generate a timer to test
+import xml.dom.minidom
+
+timer = RecordTimer.createTimer(xml.dom.minidom.parseString(
+"""
+       <timer 
+               begin="10" 
+               end="200"
+               serviceref="1:0:1:6DD2:44D:1:C00000:0:0:0:" 
+               repeated="0" 
+               name="Test Event Name" 
+               description="Test Event Description" 
+               afterevent="nothing" 
+               eit="56422" 
+               disabled="0" 
+               justplay="0">
+</timer>""").childNodes[0])
+
+t.record(timer)
 
 # run virtual environment
 enigma.run()