Improve test coverage for Mention bot.
This commit is contained in:
		
							parent
							
								
									bffb8d0e16
								
							
						
					
					
						commit
						fd97ffce77
					
				
					 1 changed files with 8 additions and 0 deletions
				
			
		|  | @ -1,6 +1,7 @@ | ||||||
| from zulip_bots.bots.mention.mention import MentionHandler | from zulip_bots.bots.mention.mention import MentionHandler | ||||||
| from unittest.mock import patch | from unittest.mock import patch | ||||||
| from zulip_bots.test_lib import BotTestCase | from zulip_bots.test_lib import BotTestCase | ||||||
|  | from zulip_bots.test_lib import StubBotHandler | ||||||
| 
 | 
 | ||||||
| class TestMentionBot(BotTestCase): | class TestMentionBot(BotTestCase): | ||||||
|     bot_name = "mention" |     bot_name = "mention" | ||||||
|  | @ -43,3 +44,10 @@ class TestMentionBot(BotTestCase): | ||||||
|             bot_response = bot_test_instance.get_mentions('TEST')[0] |             bot_response = bot_test_instance.get_mentions('TEST')[0] | ||||||
|             self.assertEqual(bot_response['title'], 'TEST') |             self.assertEqual(bot_response['title'], 'TEST') | ||||||
|             self.assertEqual(bot_response['original_url'], 'TEST') |             self.assertEqual(bot_response['original_url'], 'TEST') | ||||||
|  | 
 | ||||||
|  |     def test_exception_when_api_key_is_invalid(self) -> None: | ||||||
|  |         bot_test_instance = MentionHandler() | ||||||
|  | 
 | ||||||
|  |         with self.mock_config_info({'access_token': 'TEST'}): | ||||||
|  |             with self.assertRaises(StubBotHandler.BotQuitException): | ||||||
|  |                 bot_test_instance.initialize(StubBotHandler()) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Viraat Chandra
						Viraat Chandra