mirror of
				https://github.com/Mikaela/Limnoria.git
				synced 2025-10-31 15:47:25 +01:00 
			
		
		
		
	Factoids: Prevent empty key or value when adding a factoid.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
This commit is contained in:
		
							parent
							
								
									0540513387
								
							
						
					
					
						commit
						10f5a12b7e
					
				| @ -1,6 +1,6 @@ | ||||
| ### | ||||
| # Copyright (c) 2002-2005, Jeremiah Fincher | ||||
| # Copyright (c) 2009, James Vega | ||||
| # Copyright (c) 2009-2010, James Vega | ||||
| # All rights reserved. | ||||
| # | ||||
| # Redistribution and use in source and binary forms, with or without | ||||
| @ -63,6 +63,8 @@ def getFactoid(irc, msg, args, state): | ||||
|             key.append(args.pop(0)) | ||||
|         else: | ||||
|             value.append(args.pop(0)) | ||||
|     if not key or not value: | ||||
|         raise callbacks.ArgumentError | ||||
|     state.args.append(' '.join(key)) | ||||
|     state.args.append(' '.join(value)) | ||||
| 
 | ||||
|  | ||||
| @ -1,5 +1,6 @@ | ||||
| ### | ||||
| # Copyright (c) 2002-2005, Jeremiah Fincher | ||||
| # Copyright (c) 2010, James Vega | ||||
| # All rights reserved. | ||||
| # | ||||
| # Redistribution and use in source and binary forms, with or without | ||||
| @ -43,6 +44,8 @@ if sqlite: | ||||
|             self.assertRegexp('random', 'primary author') | ||||
| 
 | ||||
|         def testLearn(self): | ||||
|             self.assertError('learn as my primary author') | ||||
|             self.assertError('learn jemfinch as') | ||||
|             self.assertNotError('learn jemfinch as my primary author') | ||||
|             self.assertNotError('info jemfinch') | ||||
|             self.assertRegexp('whatis jemfinch', 'my primary author') | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 James Vega
						James Vega