mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-10-31 18:58:01 +00:00 
			
		
		
		
	test_status_msg: Check if message_list_response exists, otherwise pass. It will post a LANforge error output if you don't write your LANforge URL properly.
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
This commit is contained in:
		| @@ -67,6 +67,7 @@ class TestStatusMessage(LFCliBase): | ||||
|         message_response = self.json_get(self.session_url) | ||||
|         if self.debug: | ||||
|             pprint(message_response) | ||||
|         if message_response: | ||||
|             if "empty" in message_response: | ||||
|                 self._pass("empty response, zero messages") | ||||
|             elif "messages" in message_response: | ||||
| @@ -84,6 +85,7 @@ class TestStatusMessage(LFCliBase): | ||||
|                 "message": "message %s" % msg_num | ||||
|             }) | ||||
|             message_response = self.json_get(self.session_url) | ||||
|             if message_response: | ||||
|                 if len(message_response["messages"]) != msg_num: | ||||
|                     pprint(message_response) | ||||
|                     self._fail("we should have %s messages" % msg_num) | ||||
| @@ -97,6 +99,7 @@ class TestStatusMessage(LFCliBase): | ||||
|         """ | ||||
|  | ||||
|         message_list_response = self.json_get(self.session_url) | ||||
|         if message_list_response: | ||||
|             if "empty" in message_list_response: | ||||
|                 self._fail("empty response, we expect 1 or more messages") | ||||
|             msg_num = 0 | ||||
| @@ -122,6 +125,7 @@ class TestStatusMessage(LFCliBase): | ||||
|         """delete messages and delete the session""" | ||||
|  | ||||
|         message_list_response = self.json_get(self.session_url) | ||||
|         if message_list_response: | ||||
|             if "empty" in message_list_response: | ||||
|                 self._fail("empty response, we expect 1 or more messages") | ||||
|             last_link = "" | ||||
| @@ -139,6 +143,7 @@ class TestStatusMessage(LFCliBase): | ||||
|  | ||||
|         # check message removal | ||||
|         message_list_response = self.json_get(self.session_url) | ||||
|         if message_list_response: | ||||
|             msg_num = len(message_list_response["messages"]) | ||||
|             if msg_num != (self.msg_count - 1): | ||||
|                 self._fail("(cleanup) expected %s messages, saw %s" % ((self.msg_count - 1), msg_num)) | ||||
| @@ -163,7 +168,7 @@ class TestStatusMessage(LFCliBase): | ||||
|             else: | ||||
|                 self._fail("failed to delete all messages in session") | ||||
|  | ||||
|         if 'empty' in self.json_get(self.session_url).keys(): | ||||
|             if 'empty' in message_list_response.keys(): | ||||
|                 if self.debug: | ||||
|                     print("--- del -------------------- -------------------- --------------------") | ||||
|                 self.exit_on_error = False | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Matthew Stidham
					Matthew Stidham