Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/test_suite.py
diff options
context:
space:
mode:
authorThomas Jourdan <b.vehikel@googlemail.com>2009-12-22 07:03:03 (GMT)
committer Thomas Jourdan <b.vehikel@googlemail.com>2009-12-22 07:03:03 (GMT)
commit2a3a5032b4858eb6247114ff28c5108b74a4f266 (patch)
treeb79ffd2de0410b8b7698dfe5d4609a7806acac52 /test_suite.py
parenta9ef52843495f85b8cf96b1db920971bb1a116fa (diff)
Status view added
Diffstat (limited to 'test_suite.py')
-rw-r--r--test_suite.py23
1 files changed, 20 insertions, 3 deletions
diff --git a/test_suite.py b/test_suite.py
index b5c1083..fbcd146 100644
--- a/test_suite.py
+++ b/test_suite.py
@@ -14,6 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+import ka_status
import test_enumerator
import os
@@ -562,7 +563,7 @@ class TestKandidModel(unittest.TestCase):
def render_incoming(self, incoming, capacity):
for index in range(capacity):
width, height = 200, 200
- dummy, ctx = self.create_context(width, height)
+ dummy, ctx = self._create_context(width, height)
incoming.draw(index, ctx, width, height)
def test_renderSVG(self):
@@ -582,7 +583,7 @@ class TestKandidModel(unittest.TestCase):
layer.randomize()
outname = 'testoutput_' + strategy
# surface = cairo.SVGSurface(outname + '.svg', width, height)
- surface, ctx = self.create_context(width, height)
+ surface, ctx = self._create_context(width, height)
layer.render(ctx, width, height)
surface.write_to_png(outname + '.png')
@@ -599,7 +600,23 @@ class TestKandidModel(unittest.TestCase):
return #TODO
test_enumerator.explain()
- def create_context(self, width, height):
+ def test_status(self):
+ status = ka_status.Status()
+ status.set(ka_status.TOPIC_TASK,
+ ka_status.SUB_UNFINISHED,
+ '5')
+ self.assertTrue(status.isDirty())
+ status.set(ka_status.TOPIC_COLLABORATION,
+ ka_status.SUB_BUDDIES_JOINED, '2')
+ expected = '''\nCollaboration
+Buddies joined: 2
+
+Tasks
+Unfinished tasks: 5'''
+ self.assertEqual(expected, status.recall())
+ self.assertFalse(status.isDirty())
+
+ def _create_context(self, width, height):
surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, width, height)
ctx = cairo.Context(surface)
ctx.scale(width, height)