mirror of
				https://github.com/Mikaela/Limnoria.git
				synced 2025-10-31 07:37:22 +01:00 
			
		
		
		
	I honestly cannot believe that this wasn't caught sooner.
This commit is contained in:
		
							parent
							
								
									3aedb305f9
								
							
						
					
					
						commit
						0cd0a44e7d
					
				| @ -220,7 +220,10 @@ def isCtcp(msg): | ||||
| def isAction(msg): | ||||
|     """A predicate returning true if the PRIVMSG in question is an ACTION""" | ||||
|     if isCtcp(msg): | ||||
|         return len(msg.args[1].split(None, 1)) == 2 | ||||
|         s = msg.args[1] | ||||
|         payload = s[1:-1] # Chop off \x01. | ||||
|         command = payload.split(None, 1)[0] | ||||
|         return command == 'ACTION' | ||||
|     else: | ||||
|         return False | ||||
| 
 | ||||
|  | ||||
| @ -129,6 +129,12 @@ class FunctionsTestCase(SupyTestCase): | ||||
|         for msg in msgs: | ||||
|             self.failUnless(ircmsgs.isAction(msg)) | ||||
| 
 | ||||
|     def testIsActionIsntStupid(self): | ||||
|         m = ircmsgs.privmsg('#x', '\x01NOTANACTION foo\x01') | ||||
|         self.failIf(ircmsgs.isAction(m)) | ||||
|         m = ircmsgs.privmsg('#x', '\x01ACTION foo bar\x01') | ||||
|         self.failUnless(ircmsgs.isAction(m)) | ||||
| 
 | ||||
|     def testIsCtcp(self): | ||||
|         self.failUnless(ircmsgs.isCtcp(ircmsgs.privmsg('foo', | ||||
|                                                        '\x01VERSION\x01'))) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Jeremy Fincher
						Jeremy Fincher