Best Python code snippet using autotest_python
urls_common.py
Source:urls_common.py
1import os2from django.conf import urls3from django.views import generic4def generate_patterns(django_name, gwt_name):5 """6 Generates the common URL patterns for the given names7 @param django_name the full name of the Django application8 (e.g., frontend.afe)9 @param gwt_name the name of the GWT project (e.g., AfeClient)10 @return the common standard and the debug pattern lists, as a tuple11 """12 pattern_list = urls.patterns(13 django_name,14 (r'^(?:|noauth/)rpc/', 'views.handle_rpc'),15 (r'^rpc_doc', 'views.rpc_documentation'),16 )17 debug_pattern_list = urls.patterns('',18 # for GWT hosted mode19 (r'^(?P<forward_addr>autotest.*)',20 'autotest_lib.frontend.afe.views.gwt_forward'),21 # for GWT compiled files22 (r'^client/(?P<path>.*)$', 'django.views.static.serve',23 {'document_root': os.path.join(os.path.dirname(__file__), '..',24 'frontend', 'client', 'www')}),25 # redirect / to compiled client26 (r'^$', generic.RedirectView.as_view(27 url='client/autotest.%(name)s/%(name)s.html'28 % dict(name=gwt_name))),29 )...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!