| 
									
										
										
										
											2014-08-27 11:17:06 -04:00
										 |  |  | from __future__ import unicode_literals | 
					
						
							| 
									
										
										
										
											2013-08-03 17:21:25 -04:00
										 |  |  | import sure  # noqa | 
					
						
							| 
									
										
										
										
											2013-03-05 08:14:43 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | from moto.core.utils import convert_regex_to_flask_path | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_flask_path_converting_simple(): | 
					
						
							|  |  |  |     convert_regex_to_flask_path("/").should.equal("/") | 
					
						
							|  |  |  |     convert_regex_to_flask_path("/$").should.equal("/") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     convert_regex_to_flask_path("/foo").should.equal("/foo") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     convert_regex_to_flask_path("/foo/bar/").should.equal("/foo/bar/") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def test_flask_path_converting_regex(): | 
					
						
							| 
									
										
										
										
											2020-09-10 13:50:26 +05:30
										 |  |  |     convert_regex_to_flask_path(r"/(?P<key_name>[a-zA-Z0-9\-_]+)").should.equal( | 
					
						
							|  |  |  |         r'/<regex("[a-zA-Z0-9\-_]+"):key_name>' | 
					
						
							| 
									
										
										
										
											2019-10-31 08:44:26 -07:00
										 |  |  |     ) | 
					
						
							| 
									
										
										
										
											2013-03-05 08:14:43 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-09-10 13:50:26 +05:30
										 |  |  |     convert_regex_to_flask_path( | 
					
						
							|  |  |  |         r"(?P<account_id>\d+)/(?P<queue_name>.*)$" | 
					
						
							|  |  |  |     ).should.equal(r'<regex("\d+"):account_id>/<regex(".*"):queue_name>') |