How to use service_url method in localstack

Best Python code snippet using localstack_python

urls.py

Source:urls.py Github

copy

Full Screen

...75 r'^%s(?P<id>\d+)/%s$' % (pgettext('urls', 'users/'), pgettext('urls', 'edit/')),76 views.users.edit_user,77 name='edit_user'78 ),79 service_url( # ajax post only80 r'^users/set-primary-language$',81 views.users.user_set_primary_language,82 name='user_set_primary_language'83 ),84 service_url(85 r'^users/get-description$',86 views.users.get_user_description,87 name='get_user_description'88 ),89 service_url(90 r'^users/set-description$',91 views.users.set_user_description,92 name='set_user_description',93 ),94 url(95 r'^%s(?P<id>\d+)/(?P<slug>.+)/%s$' % (96 pgettext('urls', 'users/'),97 pgettext('urls', 'subscriptions/'),98 ),99 views.users.user,100 kwargs={'tab_name': 'email_subscriptions'},101 name='user_subscriptions'102 ),103 url(104 r'^%s%s$' % (105 pgettext('urls', 'users/'),106 pgettext('urls', 'unsubscribe/'),107 ),108 views.users.user_unsubscribe,109 name='user_unsubscribe'110 ),111 url(112 r'^%s(?P<id>\d+)/(?P<slug>.+)/%s$' % (113 pgettext('urls', 'users/'),114 pgettext('urls', 'select_languages/'),115 ),116 views.users.user_select_languages,117 name='user_select_languages'118 ),119 url(120 r'^%s(?P<id>\d+)/(?P<slug>.+)/$' % pgettext('urls', 'users/'),121 views.users.user,122 name='user_profile'123 ),124 url(125 r'^%s$' % pgettext('urls', 'groups/'),126 views.users.groups,127 name='groups'128 ),129 url(130 r'^%s$' % pgettext('urls', 'badges/'),131 views.meta.badges,132 name='badges'133 ),134 url(135 r'^%s(?P<id>\d+)//*' % pgettext('urls', 'badges/'),136 views.meta.badge,137 name='badge'138 ),139 url(140 r'^sitemap.xml$',141 'django.contrib.sitemaps.views.sitemap',142 {'sitemaps': sitemaps},143 name='sitemap'144 ),145 # feeds146 url(r'^feeds/rss/$', RssLastestQuestionsFeed(), name="latest_questions_feed"),147 url(r'^feeds/question/(?P<pk>\d+)/$', RssIndividualQuestionFeed(), name="individual_question_feed"),148 url(r'^%s$' % pgettext('urls', 'feedback/'), views.meta.feedback, name='feedback'),149 url(150 '^custom\.css$',151 views.meta.config_variable,152 kwargs={153 'variable_name': 'CUSTOM_CSS',154 'content_type': 'text/css'155 },156 name='custom_css'157 ),158 url(159 '^custom\.js$',160 views.meta.config_variable,161 kwargs={162 'variable_name': 'CUSTOM_JS',163 'content_type': 'text/javascript'164 },165 name='custom_js'166 ),167 service_url(r'^translate-url/', views.commands.translate_url, name='translate_url'),168 service_url(r'^reorder-badges/', views.commands.reorder_badges, name='reorder_badges'),169 service_url(r'^import-data/$', views.writers.import_data, name='import_data'),170 url(r'^%s$' % pgettext('urls', 'about/'), views.meta.about, name='about'),171 url(r'^%s$' % pgettext('urls', 'faq/'), views.meta.faq, name='faq'),172 url(r'^%s$' % pgettext('urls', 'privacy/'), views.meta.privacy, name='privacy'),173 url(174 r'^%s$' % pgettext('urls', 'terms/'),175 views.meta.markdown_flatpage,176 kwargs={'setting_name': 'TERMS', 'page_class': 'terms-page'},177 name='terms'178 ),179 url(r'^%s$' % pgettext('urls', 'help/'), views.meta.help, name='help'),180 service_url(181 r'^%s(?P<id>\d+)/%s$' % (pgettext('urls', 'answers/'), pgettext('urls', 'edit/')),182 views.writers.edit_answer,183 name='edit_answer'184 ),185 url(186 r'^%s(?P<id>\d+)/%s$' % (pgettext('urls', 'answers/'), pgettext('urls', 'revisions/')),187 views.readers.revisions,188 kwargs={'post_type': 'answer'},189 name='answer_revisions'190 ),191 service_url(192 r'^get-top-answers/',193 views.readers.get_top_answers,194 name='get_top_answers'195 ),196 # END main page urls197 service_url(198 r'^api/get_questions/',199 views.commands.api_get_questions,200 name='api_get_questions'201 ),202 service_url(203 r'^get-thread-shared-users/',204 views.commands.get_thread_shared_users,205 name='get_thread_shared_users'206 ),207 service_url(208 r'^get-thread-shared-groups/',209 views.commands.get_thread_shared_groups,210 name='get_thread_shared_groups'211 ),212 service_url(213 r'^moderate-group-join-request/',214 views.commands.moderate_group_join_request,215 name='moderate_group_join_request'216 ),217 url(218 r'^%s$' % pgettext('urls', 'moderation-queue/'),219 views.moderation.moderation_queue,220 name='moderation_queue'221 ),222 service_url(223 r'^moderate-post-edits/',224 views.moderation.moderate_post_edits,225 name='moderate_post_edits'226 ),227 service_url(228 r'^set-question-title/',229 views.commands.set_question_title,230 name='set_question_title'231 ),232 service_url(233 r'^get-question-title/',234 views.commands.get_question_title,235 name='get_question_title'236 ),237 service_url(238 r'^get-post-body/',239 views.commands.get_post_body,240 name='get_post_body'241 ),242 service_url(243 r'^set-post-body/',244 views.commands.set_post_body,245 name='set_post_body'246 ),247 service_url(248 r'^save-draft-question/',249 views.commands.save_draft_question,250 name='save_draft_question'251 ),252 service_url(253 r'^save-draft-answer/',254 views.commands.save_draft_answer,255 name='save_draft_answer'256 ),257 service_url(258 r'^share-question-with-group/',259 views.commands.share_question_with_group,260 name='share_question_with_group'261 ),262 service_url(263 r'^share-question-with-user/',264 views.commands.share_question_with_user,265 name='share_question_with_user'266 ),267 service_url(268 r'^get-users-info/',269 views.commands.get_users_info,270 name='get_users_info'271 ),272 service_url(273 r'^get-editor/',274 views.commands.get_editor,275 name='get_editor'276 ),277 service_url(278 r'^get-post-html/',279 views.readers.get_post_html,280 name='get_post_html'281 ),282 url(283 r'^%s%s$' % (MAIN_PAGE_BASE_URL, pgettext('urls', 'ask/')),284 views.writers.ask,285 name='ask'286 ),287 url(288 r'^%s(?P<id>\d+)/%s$' % (MAIN_PAGE_BASE_URL, pgettext('urls', 'edit/')),289 views.writers.edit_question,290 name='edit_question'291 ),292 service_url( # this url is both regular and ajax293 r'^%s(?P<id>\d+)/%s$' % (MAIN_PAGE_BASE_URL, pgettext('urls', 'retag/')),294 views.writers.retag_question,295 name='retag_question'296 ),297 url(298 r'^%s(?P<id>\d+)/%s$' % (MAIN_PAGE_BASE_URL, pgettext('urls', 'close/')),299 views.commands.close,300 name='close'301 ),302 url(303 r'^%s(?P<id>\d+)/%s$' % (MAIN_PAGE_BASE_URL, pgettext('urls', 'reopen/')),304 views.commands.reopen,305 name='reopen'306 ),307 service_url(308 r'^%s(?P<id>\d+)/%s$' % (MAIN_PAGE_BASE_URL, pgettext('urls', 'answer/')),309 views.writers.answer,310 name='answer'311 ),312 service_url(313 r'^merge-questions/',314 views.commands.merge_questions,315 name='merge_questions'316 ),317 service_url( # ajax only318 r'^vote$',319 views.commands.vote,320 name='vote'321 ),322 url(323 r'^%s(?P<id>\d+)/%s$' % (MAIN_PAGE_BASE_URL, pgettext('urls', 'revisions/')),324 views.readers.revisions,325 kwargs={'post_type': 'question'},326 name='question_revisions'327 ),328 service_url( # ajax only329 r'^comment/upvote/$',330 views.commands.upvote_comment,331 name='upvote_comment'332 ),333 service_url( # ajax only334 r'^post/delete/$',335 views.commands.delete_post,336 name='delete_post'337 ),338 service_url( # ajax only339 r'^post_comments/$',340 views.writers.post_comments,341 name='post_comments'342 ),343 service_url( # ajax only344 r'^edit_comment/$',345 views.writers.edit_comment,346 name='edit_comment'347 ),348 service_url( # ajax only349 r'^comment/delete/$',350 views.writers.delete_comment,351 name='delete_comment'352 ),353 service_url( # ajax only354 r'^comment/get-text/$',355 views.readers.get_comment,356 name='get_comment'357 ),358 service_url(359 r'^comment/convert/$',360 views.writers.comment_to_answer,361 name='comment_to_answer'362 ),363 service_url(364 r'^answer/repost-as-comment-under-question/$',365 views.writers.repost_answer_as_comment,366 kwargs={'destination': 'comment_under_question'},367 name='repost_answer_as_comment_under_question'368 ),369 service_url( # post only370 '^answer/repost-as-comment-under-previous-answer/$',371 views.writers.repost_answer_as_comment,372 kwargs={'destination': 'comment_under_previous_answer'},373 name='repost_answer_as_comment_under_previous_answer'374 ),375 service_url( # post only376 r'^answer/publish/$',377 views.commands.publish_answer,378 name='publish_answer'379 ),380 service_url(381 r'^%s%s$' % (pgettext('urls', 'tags/'), pgettext('urls', 'subscriptions/')),382 views.commands.list_bulk_tag_subscription,383 name='list_bulk_tag_subscription'384 ),385 service_url( # post only386 r'^%s%s%s$' % (387 pgettext('urls', 'tags/'),388 pgettext('urls', 'subscriptions/'),389 pgettext('urls', 'delete/')390 ),391 views.commands.delete_bulk_tag_subscription,392 name='delete_bulk_tag_subscription'393 ),394 service_url(395 r'^%s%s%s$' % (396 pgettext('urls', 'tags/'),397 pgettext('urls', 'subscriptions/'),398 pgettext('urls', 'create/')399 ),400 views.commands.create_bulk_tag_subscription,401 name='create_bulk_tag_subscription'402 ),403 service_url(404 r'^%s%s%s(?P<pk>\d+)/$' % (405 pgettext('urls', 'tags/'),406 pgettext('urls', 'subscriptions/'),407 pgettext('urls', 'edit/')408 ),409 views.commands.edit_bulk_tag_subscription,410 name='edit_bulk_tag_subscription'411 ),412 service_url(413 r'^%s$' % pgettext('urls', 'suggested-tags/'),414 views.meta.list_suggested_tags,415 name='list_suggested_tags'416 ),417 service_url( # ajax only418 r'^%s$' % 'moderate-suggested-tag',419 views.commands.moderate_suggested_tag,420 name='moderate_suggested_tag'421 ),422 # TODO: collapse these three urls and use an extra json data var423 service_url( # ajax only424 r'^%s%s$' % ('mark-tag/', 'interesting/'),425 views.commands.mark_tag,426 kwargs={'reason': 'good', 'action': 'add'},427 name='mark_interesting_tag'428 ),429 service_url( # ajax only430 r'^%s%s$' % ('mark-tag/', 'ignored/'),431 views.commands.mark_tag,432 kwargs={'reason': 'bad', 'action': 'add'},433 name='mark_ignored_tag'434 ),435 service_url( # ajax only436 r'^%s%s$' % ('mark-tag/', 'subscribed/'),437 views.commands.mark_tag,438 kwargs={'reason': 'subscribed', 'action': 'add'},439 name='mark_subscribed_tag'440 ),441 service_url( # ajax only442 r'^unmark-tag/',443 views.commands.mark_tag,444 kwargs={'action': 'remove'},445 name='unmark_tag'446 ),447 service_url( # ajax only448 r'^clean-tag-name/',449 views.commands.clean_tag_name,450 name='clean_tag_name'451 ),452 service_url( # ajax only453 r'^set-tag-filter-strategy/',454 views.commands.set_tag_filter_strategy,455 name='set_tag_filter_strategy'456 ),457 service_url(458 r'^get-tags-by-wildcard/',459 views.commands.get_tags_by_wildcard,460 name='get_tags_by_wildcard'461 ),462 service_url(463 r'^get-tag-list/',464 views.commands.get_tag_list,465 name='get_tag_list'466 ),467 service_url(468 r'^load-object-description/',469 views.commands.load_object_description,470 name='load_object_description'471 ),472 service_url( # ajax only473 r'^save-object-description/',474 views.commands.save_object_description,475 name='save_object_description'476 ),477 service_url( # ajax only478 r'^add-tag-category/',479 views.commands.add_tag_category,480 name='add_tag_category'481 ),482 service_url( # ajax only483 r'^rename-tag/',484 views.commands.rename_tag,485 name='rename_tag'486 ),487 service_url(488 r'^delete-tag/',489 views.commands.delete_tag,490 name='delete_tag'491 ),492 service_url( # ajax only493 r'^save-group-logo-url/',494 views.commands.save_group_logo_url,495 name='save_group_logo_url'496 ),497 service_url( # ajax only498 r'^delete-group-logo/',499 views.commands.delete_group_logo,500 name='delete_group_logo'501 ),502 service_url( # ajax only503 r'^add-group/',504 views.commands.add_group,505 name='add_group'506 ),507 service_url( # ajax only508 r'^toggle-group-profile-property/',509 views.commands.toggle_group_profile_property,510 name='toggle_group_profile_property'511 ),512 service_url( # ajax only513 r'^set-group-openness/',514 views.commands.set_group_openness,515 name='set_group_openness'516 ),517 service_url( # ajax only518 r'^edit-object-property-text/',519 views.commands.edit_object_property_text,520 name='edit_object_property_text'521 ),522 service_url(523 r'^get-groups-list/',524 views.commands.get_groups_list,525 name='get_groups_list'526 ),527 service_url(528 r'^toggle-follow-question/',529 views.commands.toggle_follow_question,530 name='toggle_follow_question'531 ),532 service_url(533 r'^subscribe-for-tags/$',534 views.commands.subscribe_for_tags,535 name='subscribe_for_tags'536 ),537 service_url(538 r'get-html-template/',539 views.commands.get_html_template,540 name='get_html_template'541 ),542 service_url( # ajax only543 r'^messages/markread/$',544 views.commands.read_message,545 name='read_message'546 ),547 service_url( # ajax only548 r'^clear-new-notifications/$',549 views.users.clear_new_notifications,550 name='clear_new_notifications'551 ),552 service_url( # ajax_only553 r'^delete-notifications/$',554 views.users.delete_notifications,555 name='delete_notifications'556 ),557 service_url( # ajax only558 r'^save-post-reject-reason/$',559 views.commands.save_post_reject_reason,560 name='save_post_reject_reason'561 ),562 service_url( # ajax only563 r'^delete-post-reject-reason/$',564 views.commands.delete_post_reject_reason,565 name='delete_post_reject_reason'566 ),567 service_url( # ajax only568 r'^edit-group-membership/$',569 views.commands.edit_group_membership,570 name='edit_group_membership'571 ),572 service_url( # ajax only573 r'^join-or-leave-group/$',574 views.commands.join_or_leave_group,575 name='join_or_leave_group'576 ),577 # widgets url!578 service_url(579 r'^%s$' % (pgettext('urls', 'widgets/')),580 views.widgets.widgets,581 name='widgets'582 ),583 service_url(584 r'^%s%s(?P<widget_id>\d+)/$' % (585 pgettext('urls', 'widgets/'),586 pgettext('urls', 'ask/')587 ),588 views.widgets.ask_widget,589 name='ask_by_widget'590 ),591 service_url(592 r'^%s%s(?P<widget_id>\d+).js$' % (593 pgettext('urls', 'widgets/'),594 pgettext('urls', 'ask/')595 ),596 views.widgets.render_ask_widget_js,597 name='render_ask_widget'598 ),599 service_url(600 r'^%s%s(?P<widget_id>\d+).css$' % (601 pgettext('urls', 'widgets/'),602 pgettext('urls', 'ask/')603 ),604 views.widgets.render_ask_widget_css,605 name='render_ask_widget_css'606 ),607 service_url(608 r'^%s%s%s$' % (609 pgettext('urls', 'widgets/'),610 pgettext('urls', 'ask/'),611 pgettext('urls', 'complete/')612 ),613 views.widgets.ask_widget_complete,614 name='ask_by_widget_complete'615 ),616 service_url(617 r'^%s(?P<model>\w+)/%s$' % (618 pgettext('urls', 'widgets/'),619 pgettext('urls', 'create/')620 ),621 views.widgets.create_widget,622 name='create_widget'623 ),624 service_url(625 r'^%s(?P<model>\w+)/%s(?P<widget_id>\d+)/$' % (626 pgettext('urls', 'widgets/'),627 pgettext('urls', 'edit/')628 ),629 views.widgets.edit_widget,630 name='edit_widget'631 ),632 service_url(633 r'^%s(?P<model>\w+)/%s(?P<widget_id>\d+)/$' % (634 pgettext('urls', 'widgets/'),635 pgettext('urls', 'delete/')636 ),637 views.widgets.delete_widget,638 name='delete_widget'639 ),640 service_url(641 r'^%s(?P<model>\w+)/$' % (pgettext('urls', 'widgets/')),642 views.widgets.list_widgets,643 name='list_widgets'644 ),645 service_url(646 r'^widgets/%s(?P<widget_id>\d+)/$' % MAIN_PAGE_BASE_URL,647 views.widgets.question_widget,648 name='question_widget'649 ),650 service_url(651 r'^get-perms-data/$',652 views.readers.get_perms_data,653 name='get_perms_data'654 ),655 service_url(656 r'^start-sharing-twitter/$',657 views.sharing.start_sharing_twitter,658 name='start_sharing_twitter'659 ),660 service_url(661 r'^save-twitter-access-token/$',662 views.sharing.save_twitter_access_token,663 name='save_twitter_access_token'664 ),665 service_url( # ajax post only666 r'^change-social-sharing-mode/$',667 views.sharing.change_social_sharing_mode,668 name='change_social_sharing_mode'669 ),670 # upload url is ajax only671 service_url(672 r'^%s$' % pgettext('urls', 'upload/'),673 views.writers.upload,674 name='upload'675 ),676 service_url(677 r'^doc/(?P<path>.*)$',678 'django.views.static.serve',679 {'document_root': os.path.join(APP_PATH, 'doc', 'build', 'html').replace('\\', '/')},680 name='askbot_docs',681 ),682 service_url(683 r'^jsi18n/$',684 'django.views.i18n.javascript_catalog',685 {'domain': 'djangojs', 'packages': ('askbot',)},686 name='askbot_jsi18n'687 ),688 service_url(r'^private-messages/', include('askbot.deps.group_messaging.urls')),689 url(r'^settings/', include('livesettings.urls')),690 url(r'^preview-emails/$', views.emails.list_emails, name='list_emails'),691 url(r'^preview-emails/(?P<slug>.+)/$', views.emails.preview_email, name='preview_email'),692 url('^api/v1/info/$', views.api_v1.info, name='api_v1_info'),693 url('^api/v1/users/$', views.api_v1.users, name='api_v1_users'),694 url('^api/v1/users/(?P<user_id>\d+)/$', views.api_v1.user, name='api_v1_user'),695 url('^api/v1/questions/$', views.api_v1.questions, name='api_v1_questions'),696 url('^api/v1/questions/(?P<question_id>\d+)/$', views.api_v1.question, name='api_v1_question'),697)698if 'askbot.deps.django_authopenid' in settings.INSTALLED_APPS:699 urlpatterns += (700 url(701 r'^%s' % pgettext('urls', 'account/'),702 include('askbot.deps.django_authopenid.urls')703 ),704 )705if 'avatar' in settings.INSTALLED_APPS:706 urlpatterns += (707 # avatar views are added here, because some need708 # either dynamic extra context or custom redirect709 # or extra parameter in the urls710 service_url(711 '^avatar/upload/(?P<user_id>\d+)/$',712 views.avatar_views.upload,713 name='askbot_avatar_upload'714 ),715 service_url(716 '^avatar/list/(?P<user_id>\d+)/$',717 views.avatar_views.show_list,718 name='askbot_avatar_show_list'719 ),720 service_url(721 '^avatar/set-primary/(?P<user_id>\d+)/$',722 views.avatar_views.set_primary,723 name='askbot_avatar_set_primary'724 ),725 service_url(726 '^avatar/delete/(?P<avatar_id>\d+)/$',727 views.avatar_views.delete,728 name='askbot_avatar_delete'729 ),730 service_url( # this url is used without changes as in the avatar app731 '^avatar/render-primary/(?P<user>[\w\d\.\-_]+)/(?P<size>[\d]+)/$',732 'avatar.views.render_primary',733 name='avatar_render_primary'734 ),735 service_url(736 '^avatar/enable-gravatar/(?P<user_id>[\d]+)/$',737 views.avatar_views.enable_gravatar,738 name='askbot_avatar_enable_gravatar'739 ),740 service_url(741 '^avatar/enable-default-avatar/(?P<user_id>[\d]+)/$',742 views.avatar_views.enable_default_avatar,743 name='askbot_avatar_enable_default_avatar'744 )...

Full Screen

Full Screen

client_test.py

Source:client_test.py Github

copy

Full Screen

1import json2import requests3# test locally or with remote service_url4service_url = "http://localhost:8000"5password = 'mosicmosic'6# service_url = "http://area-riservata.mosic2.celata.com"7# password = 'cowpony-butter-vizor'8print("Retrieving token for user mosic")9r = requests.post(10 '{0}/api-token-auth/'.format(service_url),11 {"username": "mosic", "password": password}12)13jwt_token = r.json()['token']14print(r)15print(jwt_token)16print("")17print("Retrieving seduta internal id")18response = requests.get(19 '{0}/seduta/precipe/1'.format(service_url),20 headers={'Authorization': 'JWT ' + jwt_token}21)22if 'id' in response.json():23 seduta_id = response.json()['id']24 print("")25 print("Removing seduta metadata recursively")26 response = requests.delete(27 '{0}/precipe/{1}'.format(service_url, seduta_id),28 headers={'Authorization': 'JWT ' + jwt_token}29 )30 print(response)31print("")32print("Creating seduta from json")33with open('./resources/fixtures/seduta.json'.format(service_url), 'r') as f:34 seduta = json.load(f)35response = requests.post(36 '{0}/precipe'.format(service_url),37 json=seduta,38 headers={'Authorization': 'JWT ' + jwt_token}39)40print(response)41print("")42print("Uploading Architettura file")43response = requests.put(44 '{0}/upload_file/files/architettura.pdf'.format(service_url),45 files={'file': open('./resources/fixtures/docs/architettura.pdf', 'rb')},46 headers={'Authorization': 'JWT ' + jwt_token}47)48print(response)49print("")50print("Uploading jwt-handbook file")51response = requests.put(52 '{0}/upload_file/files/JWTHandbook.pdf'.format(service_url),53 files={'file': open('./resources/fixtures/docs/jwt_handbook.pdf', 'rb')},54 headers={'Authorization': 'JWT ' + jwt_token}55)56print(response)57print("")58print("Uploading file with no corresponding record in DB")59response = requests.put(60 '{0}/upload_file/fils/JWTHandbook.pdf&format=json'.format(service_url),61 files={'file': open('./resources/fixtures/docs/jwt_handbook.pdf', 'rb')},62 headers={'Authorization': 'JWT ' + jwt_token}63)64print(response)65print("")66print("Retrieving seduta internal id")67response = requests.get(68 '{0}/seduta/precipe/1'.format(service_url),69 headers={'Authorization': 'JWT ' + jwt_token}70)71seduta_id = response.json()['id']72seduta_url = response.json()['url']73print("")74print("Retrieving full seduta")75response = requests.get(76 '{0}/precipe/{1}'.format(service_url, seduta_id),77 headers={'Authorization': 'JWT ' + jwt_token}78)79print(response)80print(response.json())...

Full Screen

Full Screen

duplicates_test.py

Source:duplicates_test.py Github

copy

Full Screen

1import json2import requests3# test locally or with remote service_url4service_url = "http://localhost:8000"5password = 'mosicmosic'6# service_url = "http://area-riservata.mosic2.celata.com"7# password = 'cowpony-butter-vizor'8print("Retrieving token for user mosic")9r = requests.post(10 '{0}/api-token-auth/'.format(service_url),11 {"username": "mosic", "password": password}12)13jwt_token = r.json()['token']14print(r)15print(jwt_token)16print("")17print("Creating seduta from json")18with open('./resources/fixtures/duplicates_1.json', 'r') as f:19 seduta_1 = json.load(f)20response = requests.post(21 '{0}/precipe'.format(service_url),22 json=seduta_1,23 headers={'Authorization': 'JWT ' + jwt_token}24)25print(response)26print("")27print("Uploading Torino file. First time.")28response = requests.put(29 '{0}/upload_file/files/torino.pdf'.format(service_url),30 files={'file': open('./resources/fixtures/docs/torino.pdf', 'rb')},31 headers={'Authorization': 'JWT ' + jwt_token}32)33print(response)34print("")35with open('./resources/fixtures/duplicates_2.json', 'r') as f:36 seduta_2 = json.load(f)37response = requests.post(38 '{0}/precipe'.format(service_url),39 json=seduta_2,40 headers={'Authorization': 'JWT ' + jwt_token}41)42print(response)43print("")44print("Uploading Torino file. Second time.")45response = requests.put(46 '{0}/upload_file/files/torino.pdf'.format(service_url),47 files={'file': open('./resources/fixtures/docs/torino.pdf', 'rb')},48 headers={'Authorization': 'JWT ' + jwt_token}49)50print(response)51print("")52# removing seduta 253print("Retrieving seduta internal id")54response = requests.get(55 '{0}/seduta/precipe/2'.format(service_url),56 headers={'Authorization': 'JWT ' + jwt_token}57)58if 'id' in response.json():59 print("Delete seduta 2")60 seduta_id = response.json()['id']61 response = requests.delete(62 '{0}/precipe/{1}'.format(service_url, seduta_id),63 headers={'Authorization': 'JWT ' + jwt_token}64 )65 print(response)66# removing seduta 367print("Retrieving seduta internal id")68response = requests.get(69 '{0}/seduta/precipe/3'.format(service_url),70 headers={'Authorization': 'JWT ' + jwt_token}71)72if 'id' in response.json():73 seduta_id = response.json()['id']74 print("Delete seduta 3")75 response = requests.delete(76 '{0}/precipe/{1}'.format(service_url, seduta_id),77 headers={'Authorization': 'JWT ' + jwt_token}78 )...

Full Screen

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run localstack automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful