From 7e7adc64713f74976d5994af36b5f758620fb37b Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sat, 13 Oct 2012 21:39:58 +0200 Subject: added JSON and WS client, re organized tests, new classes for easier api tests --- tests/test_interactionManager.py | 58 ---------------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 tests/test_interactionManager.py (limited to 'tests/test_interactionManager.py') diff --git a/tests/test_interactionManager.py b/tests/test_interactionManager.py deleted file mode 100644 index 920d84b9d..000000000 --- a/tests/test_interactionManager.py +++ /dev/null @@ -1,58 +0,0 @@ -# -*- coding: utf-8 -*- - -from unittest import TestCase -from helper.Stubs import Core - -from module.Api import Input, Output -from module.interaction.InteractionManager import InteractionManager - -class TestInteractionManager(TestCase): - - @classmethod - def setUpClass(cls): - cls.core = Core() - - def setUp(self): - self.im = InteractionManager(self.core) - - - def test_notifications(self): - - n = self.im.createNotification("test", "notify") - assert self.im.getNotifications() == [n] - - for i in range(10): - self.im.createNotification("title", "test") - - assert len(self.im.getNotifications()) == 11 - - - def test_captcha(self): - assert self.im.getTask() is None - - t = self.im.newCaptchaTask("1", "", "") - assert t.output == Output.Captcha - self.im.handleTask(t) - assert t is self.im.getTask() - - t2 = self.im.newCaptchaTask("2", "", "") - self.im.handleTask(t2) - - assert self.im.getTask(Output.Query) is None - assert self.im.getTask() is t - - self.im.removeTask(t) - assert self.im.getTask() is t2 - - self.im.getTaskByID(t2.iid) - assert self.im.getTask() is None - - - def test_query(self): - assert self.im.getTask() is None - t = self.im.newQueryTask(Input.Text, None, "text") - assert t.description == "text" - self.im.handleTask(t) - - assert self.im.getTask(Output.Query) is t - assert self.im.getTask(Output.Captcha) is None \ No newline at end of file -- cgit v1.2.3