<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Plugin_testing</title><link>https://sourceforge.net/p/gribble/wiki/Plugin_testing/</link><description>Recent changes to Plugin_testing</description><atom:link href="https://sourceforge.net/p/gribble/wiki/Plugin_testing/feed" rel="self"/><language>en</language><lastBuildDate>Fri, 05 Apr 2013 15:36:34 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/gribble/wiki/Plugin_testing/feed" rel="self" type="application/rss+xml"/><item><title>Plugin_testing modified by nanotube</title><link>https://sourceforge.net/p/gribble/wiki/Plugin_testing/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v6
+++ v7
@@ -2,7 +2,6 @@

 This page will cover some items that are not covered in those documents, or not covered very well. 

-    TODO: talk about calling non-command methods of plugins, as is done in test.py for Alias for example (in testAddRemoveAlias and in testFindBiggestDollar) 
 [TOC]

 # Running a set of plugin tests
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">nanotube</dc:creator><pubDate>Fri, 05 Apr 2013 15:36:34 -0000</pubDate><guid>https://sourceforge.net4f17ad12c298c1fd3943e8cda37333a816e0a60e</guid></item><item><title>Plugin_testing modified by nanotube</title><link>https://sourceforge.net/p/gribble/wiki/Plugin_testing/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v5
+++ v6
@@ -103,3 +103,65 @@
         m = self.getMsg(' ') #bot retrieves message, and responds. note that getMsg() requires an argument.
         self.failUnless(str(m).startswith('PRIVMSG #test :i saw some stuff')) #we str() the ircmsgs object to compare it to expected result

+
+# Testing arbitrary plugin methods; or invoking plugin methods directly
+
+Usually you can test plugin command methods in a PluginTestCase by simply sending a message with something like 
+    
+    
+    self.assertNotError('factoids whatis somestuff')
+    
+
+However, a question emerges: how do you test non-command methods? And the answer is, you can get a reference to the plugin object directly, from within your test code, using: 
+    
+    
+    # any plugin here, as long as it's in the list of plugins to be loaded
+    cb = self.irc.getCallback('Factoids')
+    
+
+Then you can invoke the plugin methods directly, with, e.g.: 
+    
+    
+    cb._replyFactoids(&amp;lt;arguments here&amp;gt;)
+    
+
+Here's a test case from the [MessageParser_Plugin], with some extra documentation comments: 
+    
+    
+    def testNullBytesHandling(self):
+        """test some stuff with null bytes
+        
+        we have to be clever here, since this doesn't behave the same as a real
+        irc message. 
+        
+        a real irc message passes in a backslash, and a zero, which later 
+        gets interpreted somewhere along the line as a \x00 char.
+        
+        here, our \0 gets interpreted as \x00 right away, and runs afoul of
+        the ircutils.isValidArgument(), which doesn't allow \x00.
+        
+        as a result, we cannot just do something like this, even though it
+        does work is a 'real irc' scenario:
+            self.assertNotError('messageparser add "foo\0bar" "echo moo\0zoob"')
+        
+        so instead, we construct the callback arguments manually and directly
+        invoke the callbacks.
+        """
+        cb = self.irc.getCallback('MessageParser')
+        msg = ircmsgs.privmsg(self.channel, '@messageparser add stuff stuff', 
+                prefix=self.prefix) # construct any dummy msg to use as arg.
+        # the self.irc object is a core object, having no reply methods.
+        # so we construct a 'real' irc object with reply methods here:
+        ircobj = callbacks.ReplyIrcProxy(self.irc, msg)
+        # now we can call the add() method directly, and supply required args.
+        cb.add(ircobj, msg, [self.channel, 'bla\0moo','echo foo'])
+        m = self.getMsg(' ') # flush response from previous call
+        # call list() directly - though at this point we could just use assertRegexp.
+        cb.list(ircobj, msg, [self.channel, ])
+        m = self.getMsg(' ')
+        # the below works, if we have successfully stored the null-byte
+        # containing string in the db.
+        self.failUnless(r'bla\x00moo' in str(m))
+    
+
+For other examples of direct method testing, see the Alias plugin test code. 
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">nanotube</dc:creator><pubDate>Fri, 05 Apr 2013 15:36:34 -0000</pubDate><guid>https://sourceforge.netf861ff526fea7e286fb306e9a6c78e95637213be</guid></item><item><title>Plugin_testing modified by nanotube</title><link>https://sourceforge.net/p/gribble/wiki/Plugin_testing/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v4
+++ v5
@@ -2,6 +2,7 @@

 This page will cover some items that are not covered in those documents, or not covered very well. 

+    TODO: talk about calling non-command methods of plugins, as is done in test.py for Alias for example (in testAddRemoveAlias and in testFindBiggestDollar) 
 [TOC]

 # Running a set of plugin tests
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">nanotube</dc:creator><pubDate>Fri, 05 Apr 2013 15:36:34 -0000</pubDate><guid>https://sourceforge.neta26a778486fbcdce993b9d8497eaaba888675066</guid></item><item><title>Plugin_testing modified by nanotube</title><link>https://sourceforge.net/p/gribble/wiki/Plugin_testing/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -6,10 +6,10 @@

 # Running a set of plugin tests

-To run the tests for some plugin, we use the _supybot-test_ script. Here's an example running a test on the MessageParser plugin without using the network: 
+To run the tests for some plugin, we use the _supybot-test_ script. Here's an example running a test on the MessageParser plugin: 

-     supybot-test --no-network MessageParser
+     supybot-test MessageParser

 The _supybot-test_ script has a number of other options, which you can explore with 
@@ -17,6 +17,14 @@

     supybot-test --help

+
+To run the tests on the core of supybot, try: 
+    
+    
+    supybot-test path/to/test
+    
+
+where _path/to/test_ is the path to the _test_ directory which is located in the root of the supybot source distribution. 

 # Channel-specific plugins

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">nanotube</dc:creator><pubDate>Fri, 05 Apr 2013 15:36:34 -0000</pubDate><guid>https://sourceforge.netb056e654783ee099254cb815285649eee5e6f8e8</guid></item><item><title>Plugin_testing modified by nanotube</title><link>https://sourceforge.net/p/gribble/wiki/Plugin_testing/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -78,3 +78,19 @@
             self.prefix = original
             conf.supybot.plugins.MessageParser.requireVacuumCapability.setValue(orig)

+
+# Send a non-command message to the bot
+
+All the 'standard' test functions such as _self.assertError()_ or _self.assertRegexp()_ send a message to the bot as a command. But what do you do if you want to send a message without it being a command? This is something I ran into when I was writing tests for the MessageParser plugin - since the plugin is precisely about responding to messages matching regexps which are _not_ direct bot commands. 
+
+For this, we have the _self.feedMsg()_ and _self.getMsg()_ methods of the test case. _feedMsg()_ sends a message, and _getMsg()_ has the bot retrieve and respond to the message. _getMsg()_ returns an [ircmsgs object](Ircmsgs_object) of the message. 
+
+Here's an example, pulled from the MessageParser test case: 
+    
+    
+    def testTrigger(self):
+        self.assertNotError('messageparser add "stuff" "echo i saw some stuff"') #add a trigger
+        self.feedMsg('this message has some stuff in it') #feed a message
+        m = self.getMsg(' ') #bot retrieves message, and responds. note that getMsg() requires an argument.
+        self.failUnless(str(m).startswith('PRIVMSG #test :i saw some stuff')) #we str() the ircmsgs object to compare it to expected result
+    
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">nanotube</dc:creator><pubDate>Fri, 05 Apr 2013 15:36:34 -0000</pubDate><guid>https://sourceforge.net2a61d50350839c6ab6a3fa751d7f27204a76168d</guid></item><item><title>Plugin_testing modified by nanotube</title><link>https://sourceforge.net/p/gribble/wiki/Plugin_testing/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -12,7 +12,7 @@
      supybot-test --no-network MessageParser

-The supybot-test script has a number of other options, which you can explore with 
+The _supybot-test_ script has a number of other options, which you can explore with 

     supybot-test --help
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">nanotube</dc:creator><pubDate>Fri, 05 Apr 2013 15:36:33 -0000</pubDate><guid>https://sourceforge.net44d7eb8f2d2681519c01194e3016a4003c5b8bf9</guid></item><item><title>Plugin_testing modified by nanotube</title><link>https://sourceforge.net/p/gribble/wiki/Plugin_testing/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Supybot comes with a robust testing framework build upon &lt;a class="" href="http://docs.python.org/library/unittest.html" rel="nofollow"&gt;python's unittest module&lt;/a&gt;. The basics of writing unit tests for supybot plugins are explained in the &lt;a class="" href="http://supybot.git.sourceforge.net/git/gitweb.cgi?p=supybot/supybot;a=blob_plain;f=docs/PLUGIN_TUTORIAL;hb=HEAD"&gt;PLUGIN_TUTORIAL&lt;/a&gt; document. Some more advanced features are detailed in the &lt;a class="" href="http://supybot.git.sourceforge.net/git/gitweb.cgi?p=supybot/supybot;a=blob_plain;f=docs/ADVANCED_PLUGIN_TESTING;hb=HEAD"&gt;ADVANCED_PLUGIN_TESTING&lt;/a&gt; document. &lt;/p&gt;
&lt;p&gt;This page will cover some items that are not covered in those documents, or not covered very well. &lt;/p&gt;
&lt;div class="toc"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#running-a-set-of-plugin-tests"&gt;Running a set of plugin tests&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#channel-specific-plugins"&gt;Channel-specific plugins&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#testing-configuration-variables"&gt;Testing configuration variables&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#test-required-capabilities"&gt;Test required capabilities&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h1 id="running-a-set-of-plugin-tests"&gt;Running a set of plugin tests&lt;/h1&gt;
&lt;p&gt;To run the tests for some plugin, we use the &lt;em&gt;supybot-test&lt;/em&gt; script. Here's an example running a test on the MessageParser plugin without using the network: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt; &lt;span class="n"&gt;supybot&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;test&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;no&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;network&lt;/span&gt; &lt;span class="n"&gt;MessageParser&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The supybot-test script has a number of other options, which you can explore with &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;supybot&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;test&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;help&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h1 id="channel-specific-plugins"&gt;Channel-specific plugins&lt;/h1&gt;
&lt;p&gt;When writing a unit test for a channel-specific plugin (i.e. that uses a per-channel database, for example), use the &lt;em&gt;ChannelPluginTestCase&lt;/em&gt; as the base class for your test case, rather than the default &lt;em&gt;PluginTestCase&lt;/em&gt;. &lt;/p&gt;
&lt;h1 id="testing-configuration-variables"&gt;Testing configuration variables&lt;/h1&gt;
&lt;p&gt;It is always a good idea to test the various config entries your plugin uses, to make sure it responds properly to different config values. In order to do this, we need to be able to change the relevant config values, then watch what happens with our plugin. &lt;/p&gt;
&lt;p&gt;The general logic flow for testing some particular function will be the following: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;test function with default config values &lt;/li&gt;
&lt;li&gt;change config value &lt;/li&gt;
&lt;li&gt;test function with different config value &lt;/li&gt;
&lt;li&gt;restore to default config value &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We will put the change of config value in a try-finally block, to make sure that even if we get failed tests within the try block, the finally clause will still reset our config to default for further tests. We will get the config values through the &lt;em&gt;conf&lt;/em&gt; object (see &lt;a class="alink" href="/p/gribble/wiki/Config/"&gt;[Config]&lt;/a&gt; for more details). &lt;/p&gt;
&lt;p&gt;So without further ado, here's a simple barebones example, from a Factoids plugin test case, with some extra juicy comments added: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;def&lt;/span&gt; &lt;span class="n"&gt;testLearnSeparator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;assertError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'learn foo is bar'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; #&lt;span class="n"&gt;default&lt;/span&gt; &lt;span class="n"&gt;learn&lt;/span&gt; &lt;span class="n"&gt;separator&lt;/span&gt; &lt;span class="n"&gt;is&lt;/span&gt; &lt;span class="s"&gt;'as'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;so&lt;/span&gt; &lt;span class="n"&gt;this&lt;/span&gt; &lt;span class="n"&gt;errors&lt;/span&gt;
    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;assertNotError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'learn foo as bar'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; #&lt;span class="n"&gt;this&lt;/span&gt; &lt;span class="n"&gt;works&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;using&lt;/span&gt; &lt;span class="n"&gt;default&lt;/span&gt; &lt;span class="n"&gt;learn&lt;/span&gt; &lt;span class="n"&gt;separator&lt;/span&gt; &lt;span class="s"&gt;'as'&lt;/span&gt;
    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;assertRegexp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'whatis foo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'bar'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; #&lt;span class="n"&gt;indeed&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;it&lt;/span&gt; &lt;span class="n"&gt;worked&lt;/span&gt;!
    &lt;span class="n"&gt;orig&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;conf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;supybot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plugins&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Factoids&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;learnSeparator&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; #&lt;span class="n"&gt;store&lt;/span&gt; &lt;span class="n"&gt;original&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;restore&lt;/span&gt; &lt;span class="n"&gt;it&lt;/span&gt; &lt;span class="n"&gt;later&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;conf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;supybot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plugins&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Factoids&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;learnSeparator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'is'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; #&lt;span class="n"&gt;set&lt;/span&gt; &lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;assertError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'learn bar as baz'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; # &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="n"&gt;it&lt;/span&gt; &lt;span class="n"&gt;fails&lt;/span&gt; &lt;span class="n"&gt;with&lt;/span&gt; &lt;span class="n"&gt;old&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;assertNotError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'learn bar is baz'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; # &lt;span class="n"&gt;but&lt;/span&gt; &lt;span class="n"&gt;works&lt;/span&gt; &lt;span class="n"&gt;with&lt;/span&gt; &lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;assertRegexp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'whatis bar'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'baz'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; #&lt;span class="n"&gt;indeed&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;it&lt;/span&gt; &lt;span class="n"&gt;worked&lt;/span&gt;!
    &lt;span class="n"&gt;finally&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;conf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;supybot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plugins&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Factoids&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;learnSeparator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;orig&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; #&lt;span class="n"&gt;restore&lt;/span&gt; &lt;span class="n"&gt;old&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="n"&gt;matter&lt;/span&gt; &lt;span class="n"&gt;what&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;h1 id="test-required-capabilities"&gt;Test required capabilities&lt;/h1&gt;
&lt;p&gt;The default testing user which is created when you run a test suite is created with 'admin' capability. This, understandably, makes it difficult to test the capability system, since an admin user is pretty powerful. Here's a well commented example of how this works, from the MessageParser test case. &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="n"&gt;def&lt;/span&gt; &lt;span class="n"&gt;testVacuum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;assertNotError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'messageparser add &amp;quot;stuff&amp;quot; &amp;quot;echo i saw some stuff&amp;quot;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;assertNotError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'messageparser remove &amp;quot;stuff&amp;quot;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; #&lt;span class="n"&gt;create&lt;/span&gt; &lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="n"&gt;remove&lt;/span&gt; &lt;span class="n"&gt;some&lt;/span&gt; &lt;span class="n"&gt;stuff&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;just&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;database&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;little&lt;/span&gt;
    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;assertNotError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'messageparser vacuum'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; # &lt;span class="n"&gt;this&lt;/span&gt; &lt;span class="n"&gt;should&lt;/span&gt; &lt;span class="n"&gt;work&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;since&lt;/span&gt; &lt;span class="n"&gt;our&lt;/span&gt; &lt;span class="n"&gt;test&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="n"&gt;has&lt;/span&gt; &lt;span class="n"&gt;admin&lt;/span&gt; &lt;span class="n"&gt;capability&lt;/span&gt; &lt;span class="n"&gt;by&lt;/span&gt; &lt;span class="n"&gt;default&lt;/span&gt;
    # &lt;span class="n"&gt;disable&lt;/span&gt; &lt;span class="n"&gt;world&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;testing&lt;/span&gt; &lt;span class="n"&gt;since&lt;/span&gt; &lt;span class="n"&gt;we&lt;/span&gt; &lt;span class="n"&gt;want&lt;/span&gt; &lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;not&lt;/span&gt;
    # &lt;span class="n"&gt;magically&lt;/span&gt; &lt;span class="n"&gt;be&lt;/span&gt; &lt;span class="n"&gt;endowed&lt;/span&gt; &lt;span class="n"&gt;with&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;admin&lt;/span&gt; &lt;span class="n"&gt;capability&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;world&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;testing&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;False&lt;/span&gt;
        &lt;span class="n"&gt;original&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;prefix&lt;/span&gt; #&lt;span class="n"&gt;store&lt;/span&gt; &lt;span class="n"&gt;first&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;later&lt;/span&gt; &lt;span class="n"&gt;restoration&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;prefix&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'stuff!stuff@stuff'&lt;/span&gt; # &lt;span class="n"&gt;create&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;assertNotError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'register nottester stuff'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;private&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="n"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; # &lt;span class="n"&gt;register&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="n"&gt;he&lt;/span&gt; &lt;span class="n"&gt;gets&lt;/span&gt; &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="n"&gt;capabilities&lt;/span&gt; &lt;span class="n"&gt;by&lt;/span&gt; &lt;span class="n"&gt;default&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;assertError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'messageparser vacuum'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; # &lt;span class="n"&gt;because&lt;/span&gt; &lt;span class="n"&gt;by&lt;/span&gt; &lt;span class="n"&gt;default&lt;/span&gt; &lt;span class="n"&gt;this&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;requires&lt;/span&gt; &lt;span class="n"&gt;admin&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;this&lt;/span&gt; &lt;span class="n"&gt;should&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt;

        &lt;span class="n"&gt;orig&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;conf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;supybot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plugins&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;MessageParser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;requireVacuumCapability&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; # &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;let&lt;/span&gt;&lt;span class="o"&gt;'&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="n"&gt;changing&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt;
        &lt;span class="n"&gt;conf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;supybot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plugins&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;MessageParser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;requireVacuumCapability&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; # &lt;span class="n"&gt;set&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;allow&lt;/span&gt; &lt;span class="n"&gt;anyone&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;vacuum_&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;assertNotError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'messageparser vacuum'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; # &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="n"&gt;our&lt;/span&gt; &lt;span class="n"&gt;new&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="n"&gt;can&lt;/span&gt; &lt;span class="n"&gt;do&lt;/span&gt; &lt;span class="n"&gt;it&lt;/span&gt;!
    &lt;span class="n"&gt;finally&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; #&lt;span class="n"&gt;restore&lt;/span&gt; &lt;span class="n"&gt;everything&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;way&lt;/span&gt; &lt;span class="n"&gt;it&lt;/span&gt; &lt;span class="n"&gt;was&lt;/span&gt; &lt;span class="n"&gt;before&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;no&lt;/span&gt; &lt;span class="n"&gt;matter&lt;/span&gt; &lt;span class="n"&gt;what&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
        &lt;span class="n"&gt;world&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;testing&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;True&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;prefix&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;original&lt;/span&gt;
        &lt;span class="n"&gt;conf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;supybot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plugins&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;MessageParser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;requireVacuumCapability&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;orig&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">nanotube</dc:creator><pubDate>Fri, 05 Apr 2013 15:36:33 -0000</pubDate><guid>https://sourceforge.net88cdc514792fec0d50e44918d1644ccba3e5b632</guid></item></channel></rss>