| 
									
										
										
										
											2015-08-03 22:48:15 +02:00
										 |  |  | import re | 
					
						
							| 
									
										
										
										
											2022-03-11 20:28:45 -01:00
										 |  |  | import sure  # noqa # pylint: disable=unused-import | 
					
						
							| 
									
										
										
										
											2015-08-03 22:48:15 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | import moto.server as server | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-31 08:44:26 -07:00
										 |  |  | """
 | 
					
						
							| 
									
										
										
										
											2015-08-03 22:48:15 +02:00
										 |  |  | Test the different server responses | 
					
						
							| 
									
										
										
										
											2019-10-31 08:44:26 -07:00
										 |  |  | """
 | 
					
						
							| 
									
										
										
										
											2015-08-03 22:48:15 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_iam_server_get(): | 
					
						
							|  |  |  |     backend = server.create_backend_app("iam") | 
					
						
							|  |  |  |     test_client = backend.test_client() | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-23 21:37:43 -05:00
										 |  |  |     group_data = test_client.action_data( | 
					
						
							| 
									
										
										
										
											2019-10-31 08:44:26 -07:00
										 |  |  |         "CreateGroup", GroupName="test group", Path="/" | 
					
						
							|  |  |  |     ) | 
					
						
							| 
									
										
										
										
											2015-08-03 22:48:15 +02:00
										 |  |  |     group_id = re.search("<GroupId>(.*)</GroupId>", group_data).groups()[0] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     groups_data = test_client.action_data("ListGroups") | 
					
						
							|  |  |  |     groups_ids = re.findall("<GroupId>(.*)</GroupId>", groups_data) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-23 21:37:43 -05:00
										 |  |  |     assert group_id in groups_ids |