Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/stateview.py
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@sugarlabs.org>2014-04-16 04:13:08 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2014-05-14 21:21:41 (GMT)
commitc4abfa53582570684cf3262b0ecab69e265999f5 (patch)
tree35d0462d84ec5d3c350f322d070935255375c426 /stateview.py
parent8da6a5e066effa5d92d5b284fc0d7d3f1d09892e (diff)
Fix stateview test
Diffstat (limited to 'stateview.py')
-rw-r--r--stateview.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/stateview.py b/stateview.py
index 2f5a3c2..8d85739 100644
--- a/stateview.py
+++ b/stateview.py
@@ -9,7 +9,6 @@
from gi.repository import Gtk
from gi.repository import Rsvg
import cairo
-import model
import math
import logging
@@ -72,9 +71,15 @@ class StateView():
ctx.restore()
+class FakeModel():
+
+ def __init__(self):
+ self.data = {}
+ self.data['questions'] = []
+
def main():
window = Gtk.Window()
- _model = model.GameModel()
+ _model = FakeModel()
state_view = StateView(_model, 10, 10, 20)
area = Gtk.DrawingArea()
@@ -86,7 +91,7 @@ def main():
_model.data['questions'].append('')
# ...and a fake state
- state = {'displayed_questions': 3, 'replied_questions': 2}
+ state = {'displayed_questions': ['1','2','3'], 'replied_questions': ['1','2']}
_model.data['state'] = state
def __draw_cb(widget, ctx, state_view):