Commits

Marc-Alexandre Chan committed ef3a9ec

test code bugfix

Comments (0)

Files changed (2)

minibot/config/localtest/minibot-setup.py

         self.last_event = event
         self.events.append(event)
 
-    def print_event(index=-1):
+    def print_event(self, index=-1):
         print repr(self.events[index])

minibot/config/localtest/notes.txt

->>> execfile('D:\Projects\Software\DailyPrompt\minibot\config\localtest\minibot-setup.py')
->>> import minibot.events
->>> ev=minibot.events.PromptCommandBase
->>> ev=ev(1, title='title', text='text')
->>> res = {'reddit' : reddit, 'dbsession' : db.get_new_session(), 'config.minibot' : config.minibot, 'logger' : log}
->>> ev.res = res
->>> 
+execfile('D:\Projects\Software\DailyPrompt\minibot\config\localtest\minibot-setup.py');
+import minibot.events;
+ev=minibot.events.PromptCommandBase(1, title='title', text='text');
+res = {'reddit' : reddit, 'dbsession' : db.get_new_session(), 'config.minibot' : config.minibot, 'logger' : log};
+msg=list(reddit.user.get_unread())[0];
+msg_params={'user': 'awkisopen', 'submission': 'http://www.reddit.com/r/WTF/comments/yzvm8/childrens_book_editing_fail/c60iltd', 'title': 'Vote today!', 'date': '2012-09-04', 'text': 'This is a plain text block.', 'time': '19:44'}
+owner=SchedulerMock()
+
+reload(minibot.events)
+ev = minibot.events.AddPromptCommand(msg, **msg_params)
+ev.res=res
+ev.owner=owner