mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	test-events: Test do_delete_message with no messages specified.
Test coverage for `zerver/actions/message_delete.py`. Both callers of this function would already return if there were no Messages specified to delete, which is why existing tests did not cover this.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							7ccfed65e8
						
					
				
				
					commit
					df17a1bf28
				
			@@ -76,7 +76,6 @@ not_yet_fully_covered = [
 | 
			
		||||
    "analytics/views/support.py",
 | 
			
		||||
    # Major lib files should have 100% coverage
 | 
			
		||||
    "zerver/actions/create_realm.py",
 | 
			
		||||
    "zerver/actions/message_delete.py",
 | 
			
		||||
    "zerver/actions/message_edit.py",
 | 
			
		||||
    "zerver/actions/presence.py",
 | 
			
		||||
    "zerver/actions/scheduled_messages.py",
 | 
			
		||||
 
 | 
			
		||||
@@ -2512,6 +2512,14 @@ class NormalActionsTest(BaseAction):
 | 
			
		||||
        result = fetch_initial_state_data(user_profile)
 | 
			
		||||
        self.assertEqual(result["max_message_id"], -1)
 | 
			
		||||
 | 
			
		||||
    def test_do_delete_message_with_no_messages(self) -> None:
 | 
			
		||||
        events = self.verify_action(
 | 
			
		||||
            lambda: do_delete_messages(self.user_profile.realm, []),
 | 
			
		||||
            num_events=0,
 | 
			
		||||
            state_change_expected=False,
 | 
			
		||||
        )
 | 
			
		||||
        self.assertEqual(events, [])
 | 
			
		||||
 | 
			
		||||
    def test_add_attachment(self) -> None:
 | 
			
		||||
        self.login("hamlet")
 | 
			
		||||
        fp = StringIO("zulip!")
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user