Best Python code snippet using playwright-python
test_api_assembly_strategy_combinations_book_then_lang.py
Source:test_api_assembly_strategy_combinations_book_then_lang.py
1import os2import pathlib3import re4import bs45import pytest6import requests7from fastapi.testclient import TestClient8from document.config import settings9from document.entrypoints.app import app10##################################################11## Tests for assembly strategy book -hen-language12def check_finished_document_with_verses_success(13 response: requests.Response, finished_document_path: str14) -> None:15 """16 Helper to keep tests DRY.17 Check that the finished_document_path exists and also check that18 the HTML file associated with it exists and includes verses_html.19 """20 finished_document_path = os.path.join(settings.output_dir(), finished_document_path)21 assert os.path.isfile(finished_document_path)22 html_file = "{}.html".format(finished_document_path.split(".")[0])23 assert os.path.isfile(html_file)24 assert response.json() == {25 "finished_document_request_key": pathlib.Path(finished_document_path).stem,26 "message": settings.SUCCESS_MESSAGE,27 }28 with open(html_file, "r") as fin:29 html = fin.read()30 parser = bs4.BeautifulSoup(html, "html.parser")31 body: bs4.elements.ResultSet = parser.find_all("body")32 assert body33 verses_html: bs4.elements.ResultSet = parser.find_all(34 "span", attrs={"class": "v-num"}35 )36 assert verses_html37 assert response.ok38def check_finished_document_with_body_success(39 response: requests.Response, finished_document_path: str40) -> None:41 """42 Helper to keep tests DRY.43 Check that the finished_document_path exists and also check that44 the HTML file associated with it exists and includes body.45 """46 finished_document_path = os.path.join(settings.output_dir(), finished_document_path)47 assert os.path.isfile(finished_document_path)48 html_file = "{}.html".format(finished_document_path.split(".")[0])49 assert os.path.isfile(html_file)50 assert response.json() == {51 "finished_document_request_key": pathlib.Path(finished_document_path).stem,52 "message": settings.SUCCESS_MESSAGE,53 }54 with open(html_file, "r") as fin:55 html = fin.read()56 parser = bs4.BeautifulSoup(html, "html.parser")57 body: bs4.elements.ResultSet = parser.find_all("body")58 assert body59 assert response.ok60def check_finished_document_without_verses_success(61 response: requests.Response, finished_document_path: str62) -> None:63 """64 Helper to keep tests DRY.65 Check that the finished_document_path exists and also check that66 the HTML file associated with it exists and includes body but not67 verses_html.68 """69 finished_document_path = os.path.join(settings.output_dir(), finished_document_path)70 assert os.path.exists(finished_document_path)71 html_file = "{}.html".format(finished_document_path.split(".")[0])72 assert os.path.exists(html_file)73 with open(html_file, "r") as fin:74 html = fin.read()75 parser = bs4.BeautifulSoup(html, "html.parser")76 body: bs4.elements.ResultSet = parser.find_all("body")77 assert body78 verses_html: bs4.elements.ResultSet = parser.find_all(79 "span", attrs={"class": "v-num"}80 )81 # reg is malformed and udb does not exist, thus there is82 # no html generated83 assert not verses_html84 assert response.ok85def test_en_ulb_wa_col_en_tn_wa_col_en_tq_wa_col_en_tw_wa_col_fr_f10_col_fr_tn_col_fr_tq_col_fr_tw_col_book_language_order() -> None:86 with TestClient(app=app, base_url=settings.api_test_url()) as client:87 response: requests.Response = client.post(88 "/documents",89 json={90 "email_address": settings.TO_EMAIL_ADDRESS,91 "assembly_strategy_kind": "book_language_order",92 "resource_requests": [93 {94 "lang_code": "en",95 "resource_type": "ulb-wa",96 "resource_code": "col",97 },98 {99 "lang_code": "en",100 "resource_type": "tn-wa",101 "resource_code": "col",102 },103 {104 "lang_code": "en",105 "resource_type": "tq-wa",106 "resource_code": "col",107 },108 {109 "lang_code": "en",110 "resource_type": "tw-wa",111 "resource_code": "col",112 },113 {114 "lang_code": "fr",115 "resource_type": "f10",116 "resource_code": "col",117 },118 {119 "lang_code": "fr",120 "resource_type": "tn",121 "resource_code": "col",122 },123 {124 "lang_code": "fr",125 "resource_type": "tq",126 "resource_code": "col",127 },128 {129 "lang_code": "fr",130 "resource_type": "tw",131 "resource_code": "col",132 },133 ],134 },135 )136 finished_document_path = "en-ulb-wa-col_en-tn-wa-col_en-tq-wa-col_en-tw-wa-col_fr-f10-col_fr-tn-col_fr-tq-col_fr-tw-col_book_language_order.pdf"137 check_finished_document_with_verses_success(response, finished_document_path)138def test_en_ulb_wa_col_en_tn_wa_col_en_tq_wa_col_en_tw_wa_col_pt_br_ulb_col_pt_br_tn_col_pt_br_tq_col_pt_br_tw_col_book_language_order() -> None:139 with TestClient(app=app, base_url=settings.api_test_url()) as client:140 response: requests.Response = client.post(141 "/documents",142 json={143 "email_address": settings.TO_EMAIL_ADDRESS,144 "assembly_strategy_kind": "book_language_order",145 "resource_requests": [146 {147 "lang_code": "en",148 "resource_type": "ulb-wa",149 "resource_code": "col",150 },151 {152 "lang_code": "en",153 "resource_type": "tn-wa",154 "resource_code": "col",155 },156 {157 "lang_code": "en",158 "resource_type": "tq-wa",159 "resource_code": "col",160 },161 {162 "lang_code": "en",163 "resource_type": "tw-wa",164 "resource_code": "col",165 },166 {167 "lang_code": "pt-br",168 "resource_type": "ulb",169 "resource_code": "col",170 },171 {172 "lang_code": "pt-br",173 "resource_type": "tn",174 "resource_code": "col",175 },176 {177 "lang_code": "pt-br",178 "resource_type": "tq",179 "resource_code": "col",180 },181 {182 "lang_code": "pt-br",183 "resource_type": "tw",184 "resource_code": "col",185 },186 ],187 },188 )189 finished_document_path = "en-ulb-wa-col_en-tn-wa-col_en-tq-wa-col_en-tw-wa-col_pt-br-ulb-col_pt-br-tn-col_pt-br-tq-col_pt-br-tw-col_book_language_order.pdf"190 check_finished_document_with_verses_success(response, finished_document_path)191def test_pt_br_ulb_col_pt_br_tn_col_pt_br_tq_col_pt_br_tw_col_book_language_order() -> None:192 with TestClient(app=app, base_url=settings.api_test_url()) as client:193 response: requests.Response = client.post(194 "/documents",195 json={196 "email_address": settings.TO_EMAIL_ADDRESS,197 "assembly_strategy_kind": "book_language_order",198 "resource_requests": [199 {200 "lang_code": "pt-br",201 "resource_type": "ulb",202 "resource_code": "col",203 },204 {205 "lang_code": "pt-br",206 "resource_type": "tn",207 "resource_code": "col",208 },209 {210 "lang_code": "pt-br",211 "resource_type": "tq",212 "resource_code": "col",213 },214 {215 "lang_code": "pt-br",216 "resource_type": "tw",217 "resource_code": "col",218 },219 ],220 },221 )222 finished_document_path = "pt-br-ulb-col_pt-br-tn-col_pt-br-tq-col_pt-br-tw-col_book_language_order.pdf"223 check_finished_document_with_verses_success(response, finished_document_path)224def test_fr_f10_col_fr_tn_col_fr_tq_col_fr_tw_col_book_language_order() -> None:225 with TestClient(app=app, base_url=settings.api_test_url()) as client:226 response: requests.Response = client.post(227 "/documents",228 json={229 "email_address": settings.TO_EMAIL_ADDRESS,230 "assembly_strategy_kind": "book_language_order",231 "resource_requests": [232 {233 "lang_code": "fr",234 "resource_type": "f10",235 "resource_code": "col",236 },237 {238 "lang_code": "fr",239 "resource_type": "tn",240 "resource_code": "col",241 },242 {243 "lang_code": "fr",244 "resource_type": "tq",245 "resource_code": "col",246 },247 {248 "lang_code": "fr",249 "resource_type": "tw",250 "resource_code": "col",251 },252 ],253 },254 )255 finished_document_path = (256 "fr-f10-col_fr-tn-col_fr-tq-col_fr-tw-col_book_language_order.pdf"257 )258 check_finished_document_with_verses_success(response, finished_document_path)259def test_en_ulb_wa_col_en_tn_wa_col_en_tq_wa_col_en_tw_wa_col_tl_ulb_col_tl_tn_col_tl_tq_col_tl_tw_col_tl_udb_col_book_language_order() -> None:260 with TestClient(app=app, base_url=settings.api_test_url()) as client:261 response: requests.Response = client.post(262 "/documents",263 json={264 "email_address": settings.TO_EMAIL_ADDRESS,265 "assembly_strategy_kind": "book_language_order",266 "resource_requests": [267 {268 "lang_code": "en",269 "resource_type": "ulb-wa",270 "resource_code": "col",271 },272 {273 "lang_code": "en",274 "resource_type": "tn-wa",275 "resource_code": "col",276 },277 {278 "lang_code": "en",279 "resource_type": "tq-wa",280 "resource_code": "col",281 },282 {283 "lang_code": "en",284 "resource_type": "tw-wa",285 "resource_code": "col",286 },287 {288 "lang_code": "tl",289 "resource_type": "ulb",290 "resource_code": "col",291 },292 {293 "lang_code": "tl",294 "resource_type": "tn",295 "resource_code": "col",296 },297 {298 "lang_code": "tl",299 "resource_type": "tq",300 "resource_code": "col",301 },302 {303 "lang_code": "tl",304 "resource_type": "tw",305 "resource_code": "col",306 },307 {308 "lang_code": "tl",309 "resource_type": "udb",310 "resource_code": "col",311 },312 ],313 },314 )315 finished_document_path = "en-ulb-wa-col_en-tn-wa-col_en-tq-wa-col_en-tw-wa-col_tl-ulb-col_tl-tn-col_tl-tq-col_tl-tw-col_tl-udb-col_book_language_order.pdf"316 check_finished_document_with_verses_success(response, finished_document_path)317def test_en_ulb_wa_tit_en_tn_wa_tit_book_language_order() -> None:318 "English ulb-wa and tn-wa for book of Timothy."319 with TestClient(app=app, base_url=settings.api_test_url()) as client:320 response: requests.Response = client.post(321 "/documents",322 json={323 "email_address": settings.TO_EMAIL_ADDRESS,324 "assembly_strategy_kind": "book_language_order",325 "resource_requests": [326 {327 "lang_code": "en",328 "resource_type": "ulb-wa",329 "resource_code": "tit",330 },331 {332 "lang_code": "en",333 "resource_type": "tn-wa",334 "resource_code": "tit",335 },336 ],337 },338 )339 finished_document_path = "en-ulb-wa-tit_en-tn-wa-tit_book_language_order.pdf"340 finished_document_path = os.path.join(341 settings.output_dir(), finished_document_path342 )343 assert os.path.isfile(finished_document_path)344 assert response.json() == {345 "finished_document_request_key": pathlib.Path(finished_document_path).stem,346 "message": settings.SUCCESS_MESSAGE,347 }348def test_sw_ulb_col_sw_tn_col_book_language_order() -> None:349 with TestClient(app=app, base_url=settings.api_test_url()) as client:350 response: requests.Response = client.post(351 "/documents",352 json={353 "email_address": settings.TO_EMAIL_ADDRESS,354 "assembly_strategy_kind": "book_language_order",355 "resource_requests": [356 {357 "lang_code": "sw",358 "resource_type": "ulb",359 "resource_code": "col",360 },361 {362 "lang_code": "sw",363 "resource_type": "tn",364 "resource_code": "col",365 },366 ],367 },368 )369 finished_document_path = "sw-ulb-col_sw-tn-col_book_language_order.pdf"370 check_finished_document_with_verses_success(response, finished_document_path)371def test_sw_ulb_col_sw_tn_col_sw_ulb_tit_sw_tn_tit_book_language_order() -> None:372 with TestClient(app=app, base_url=settings.api_test_url()) as client:373 response: requests.Response = client.post(374 "/documents",375 json={376 "email_address": settings.TO_EMAIL_ADDRESS,377 "assembly_strategy_kind": "book_language_order",378 "resource_requests": [379 {380 "lang_code": "sw",381 "resource_type": "ulb",382 "resource_code": "col",383 },384 {385 "lang_code": "sw",386 "resource_type": "tn",387 "resource_code": "col",388 },389 {390 "lang_code": "sw",391 "resource_type": "ulb",392 "resource_code": "tit",393 },394 {395 "lang_code": "sw",396 "resource_type": "tn",397 "resource_code": "tit",398 },399 ],400 },401 )402 finished_document_path = (403 "sw-ulb-col_sw-tn-col_sw-ulb-tit_sw-tn-tit_book_language_order.pdf"404 )405 check_finished_document_with_verses_success(response, finished_document_path)406def test_en_ulb_wa_col_en_tn_wa_col_sw_ulb_col_sw_tn_col_sw_ulb_tit_sw_tn_tit_book_language_order() -> None:407 with TestClient(app=app, base_url=settings.api_test_url()) as client:408 response: requests.Response = client.post(409 "/documents",410 json={411 "email_address": settings.TO_EMAIL_ADDRESS,412 "assembly_strategy_kind": "book_language_order",413 "resource_requests": [414 {415 "lang_code": "en",416 "resource_type": "ulb-wa",417 "resource_code": "col",418 },419 {420 "lang_code": "en",421 "resource_type": "tn-wa",422 "resource_code": "col",423 },424 {425 "lang_code": "sw",426 "resource_type": "ulb",427 "resource_code": "col",428 },429 {430 "lang_code": "sw",431 "resource_type": "tn",432 "resource_code": "col",433 },434 {435 "lang_code": "sw",436 "resource_type": "ulb",437 "resource_code": "tit",438 },439 {440 "lang_code": "sw",441 "resource_type": "tn",442 "resource_code": "tit",443 },444 ],445 },446 )447 finished_document_path = "en-ulb-wa-col_en-tn-wa-col_sw-ulb-col_sw-tn-col_sw-ulb-tit_sw-tn-tit_book_language_order.pdf"448 check_finished_document_with_verses_success(response, finished_document_path)449def test_en_ulb_wa_col_en_tn_wa_col_en_tq_wa_col_sw_ulb_col_sw_tn_col_sw_tq_col_sw_ulb_tit_sw_tn_tit_sw_tq_tit_book_language_order() -> None:450 with TestClient(app=app, base_url=settings.api_test_url()) as client:451 response: requests.Response = client.post(452 "/documents",453 json={454 "email_address": settings.TO_EMAIL_ADDRESS,455 "assembly_strategy_kind": "book_language_order",456 "resource_requests": [457 {458 "lang_code": "en",459 "resource_type": "ulb-wa",460 "resource_code": "col",461 },462 {463 "lang_code": "en",464 "resource_type": "tn-wa",465 "resource_code": "col",466 },467 {468 "lang_code": "en",469 "resource_type": "tq-wa",470 "resource_code": "col",471 },472 {473 "lang_code": "sw",474 "resource_type": "ulb",475 "resource_code": "col",476 },477 {478 "lang_code": "sw",479 "resource_type": "tn",480 "resource_code": "col",481 },482 {483 "lang_code": "sw",484 "resource_type": "tq",485 "resource_code": "col",486 },487 {488 "lang_code": "sw",489 "resource_type": "ulb",490 "resource_code": "tit",491 },492 {493 "lang_code": "sw",494 "resource_type": "tn",495 "resource_code": "tit",496 },497 {498 "lang_code": "sw",499 "resource_type": "tq",500 "resource_code": "tit",501 },502 ],503 },504 )505 finished_document_path = "en-ulb-wa-col_en-tn-wa-col_en-tq-wa-col_sw-ulb-col_sw-tn-col_sw-tq-col_sw-ulb-tit_sw-tn-tit_sw-tq-tit_book_language_order.pdf"506 check_finished_document_with_verses_success(response, finished_document_path)507def test_en_ulb_wa_col_en_tq_wa_col_sw_ulb_col_sw_tq_col_sw_ulb_tit_sw_tq_tit_book_language_order() -> None:508 with TestClient(app=app, base_url=settings.api_test_url()) as client:509 response: requests.Response = client.post(510 "/documents",511 json={512 "email_address": settings.TO_EMAIL_ADDRESS,513 "assembly_strategy_kind": "book_language_order",514 "resource_requests": [515 {516 "lang_code": "en",517 "resource_type": "ulb-wa",518 "resource_code": "col",519 },520 {521 "lang_code": "en",522 "resource_type": "tq-wa",523 "resource_code": "col",524 },525 {526 "lang_code": "sw",527 "resource_type": "ulb",528 "resource_code": "col",529 },530 {531 "lang_code": "sw",532 "resource_type": "tq",533 "resource_code": "col",534 },535 {536 "lang_code": "sw",537 "resource_type": "ulb",538 "resource_code": "tit",539 },540 {541 "lang_code": "sw",542 "resource_type": "tq",543 "resource_code": "tit",544 },545 ],546 },547 )548 finished_document_path = "en-ulb-wa-col_en-tq-wa-col_sw-ulb-col_sw-tq-col_sw-ulb-tit_sw-tq-tit_book_language_order.pdf"549 check_finished_document_with_verses_success(response, finished_document_path)550def test_en_tn_wa_col_en_tq_wa_col_en_tw_wa_col_sw_tn_col_sw_tq_col_sw_tw_col_sw_tn_tit_sw_tq_tit_sw_tw_tit_book_language_order() -> None:551 with TestClient(app=app, base_url=settings.api_test_url()) as client:552 response: requests.Response = client.post(553 "/documents",554 json={555 "email_address": settings.TO_EMAIL_ADDRESS,556 "assembly_strategy_kind": "book_language_order",557 "resource_requests": [558 {559 "lang_code": "en",560 "resource_type": "tn-wa",561 "resource_code": "col",562 },563 {564 "lang_code": "en",565 "resource_type": "tq-wa",566 "resource_code": "col",567 },568 {569 "lang_code": "en",570 "resource_type": "tw-wa",571 "resource_code": "col",572 },573 {574 "lang_code": "sw",575 "resource_type": "tn",576 "resource_code": "col",577 },578 {579 "lang_code": "sw",580 "resource_type": "tq",581 "resource_code": "col",582 },583 {584 "lang_code": "sw",585 "resource_type": "tw",586 "resource_code": "col",587 },588 {589 "lang_code": "sw",590 "resource_type": "tn",591 "resource_code": "tit",592 },593 {594 "lang_code": "sw",595 "resource_type": "tq",596 "resource_code": "tit",597 },598 {599 "lang_code": "sw",600 "resource_type": "tw",601 "resource_code": "tit",602 },603 ],604 },605 )606 finished_document_path = "en-tn-wa-col_en-tq-wa-col_en-tw-wa-col_sw-tn-col_sw-tq-col_sw-tw-col_sw-tn-tit_sw-tq-tit_sw-tw-tit_book_language_order.pdf"607 check_finished_document_with_body_success(response, finished_document_path)608def test_en_tn_wa_col_en_tw_wa_col_sw_tn_col_sw_tw_col_sw_tn_tit_sw_tw_tit_book_language_order() -> None:609 with TestClient(app=app, base_url=settings.api_test_url()) as client:610 response: requests.Response = client.post(611 "/documents",612 json={613 "email_address": settings.TO_EMAIL_ADDRESS,614 "assembly_strategy_kind": "book_language_order",615 "resource_requests": [616 {617 "lang_code": "en",618 "resource_type": "tn-wa",619 "resource_code": "col",620 },621 {622 "lang_code": "en",623 "resource_type": "tw-wa",624 "resource_code": "col",625 },626 {627 "lang_code": "sw",628 "resource_type": "tn",629 "resource_code": "col",630 },631 {632 "lang_code": "sw",633 "resource_type": "tw",634 "resource_code": "col",635 },636 {637 "lang_code": "sw",638 "resource_type": "tn",639 "resource_code": "tit",640 },641 {642 "lang_code": "sw",643 "resource_type": "tw",644 "resource_code": "tit",645 },646 ],647 },648 )649 finished_document_path = "en-tn-wa-col_en-tw-wa-col_sw-tn-col_sw-tw-col_sw-tn-tit_sw-tw-tit_book_language_order.pdf"650 check_finished_document_with_body_success(response, finished_document_path)651def test_en_tq_wa_col_en_tw_wa_col_sw_tq_col_sw_tw_col_sw_tq_tit_sw_tw_tit_book_language_order() -> None:652 with TestClient(app=app, base_url=settings.api_test_url()) as client:653 response: requests.Response = client.post(654 "/documents",655 json={656 "email_address": settings.TO_EMAIL_ADDRESS,657 "assembly_strategy_kind": "book_language_order",658 "resource_requests": [659 {660 "lang_code": "en",661 "resource_type": "tq-wa",662 "resource_code": "col",663 },664 {665 "lang_code": "en",666 "resource_type": "tw-wa",667 "resource_code": "col",668 },669 {670 "lang_code": "sw",671 "resource_type": "tq",672 "resource_code": "col",673 },674 {675 "lang_code": "sw",676 "resource_type": "tw",677 "resource_code": "col",678 },679 ],680 },681 )682 finished_document_path = (683 "en-tq-wa-col_en-tw-wa-col_sw-tq-col_sw-tw-col_book_language_order.pdf"684 )685 check_finished_document_with_body_success(response, finished_document_path)686def test_en_tw_wa_col_sw_tw_col_sw_tw_tit_book_language_order() -> None:687 with TestClient(app=app, base_url=settings.api_test_url()) as client:688 response: requests.Response = client.post(689 "/documents",690 json={691 "email_address": settings.TO_EMAIL_ADDRESS,692 "assembly_strategy_kind": "book_language_order",693 "resource_requests": [694 {695 "lang_code": "en",696 "resource_type": "tw-wa",697 "resource_code": "col",698 },699 {700 "lang_code": "sw",701 "resource_type": "tw",702 "resource_code": "col",703 },704 ],705 },706 )707 finished_document_path = "en-tw-wa-col_sw-tw-col_book_language_order.pdf"708 check_finished_document_with_body_success(response, finished_document_path)709def test_en_tn_wa_col_en_tq_wa_col_sw_tn_col_sw_tq_col_sw_tn_tit_sw_tq_tit_book_language_order() -> None:710 with TestClient(app=app, base_url=settings.api_test_url()) as client:711 response: requests.Response = client.post(712 "/documents",713 json={714 "email_address": settings.TO_EMAIL_ADDRESS,715 "assembly_strategy_kind": "book_language_order",716 "resource_requests": [717 {718 "lang_code": "en",719 "resource_type": "tn-wa",720 "resource_code": "col",721 },722 {723 "lang_code": "en",724 "resource_type": "tq-wa",725 "resource_code": "col",726 },727 {728 "lang_code": "sw",729 "resource_type": "tn",730 "resource_code": "col",731 },732 {733 "lang_code": "sw",734 "resource_type": "tq",735 "resource_code": "col",736 },737 ],738 },739 )740 finished_document_path = (741 "en-tn-wa-col_en-tq-wa-col_sw-tn-col_sw-tq-col_book_language_order.pdf"742 )743 check_finished_document_with_body_success(response, finished_document_path)744def test_en_tq_wa_col_sw_tq_col_sw_tq_tit_book_language_order() -> None:745 with TestClient(app=app, base_url=settings.api_test_url()) as client:746 response: requests.Response = client.post(747 "/documents",748 json={749 "email_address": settings.TO_EMAIL_ADDRESS,750 "assembly_strategy_kind": "book_language_order",751 "resource_requests": [752 {753 "lang_code": "en",754 "resource_type": "tq-wa",755 "resource_code": "col",756 },757 {758 "lang_code": "sw",759 "resource_type": "tq",760 "resource_code": "col",761 },762 ],763 },764 )765 finished_document_path = "en-tq-wa-col_sw-tq-col_book_language_order.pdf"766 check_finished_document_with_body_success(response, finished_document_path)767def test_en_tn_wa_col_sw_tn_col_sw_tn_tit_book_language_order() -> None:768 with TestClient(app=app, base_url=settings.api_test_url()) as client:769 response: requests.Response = client.post(770 "/documents",771 json={772 "email_address": settings.TO_EMAIL_ADDRESS,773 "assembly_strategy_kind": "book_language_order",774 "resource_requests": [775 {776 "lang_code": "en",777 "resource_type": "tn-wa",778 "resource_code": "col",779 },780 {781 "lang_code": "sw",782 "resource_type": "tn",783 "resource_code": "col",784 },785 {786 "lang_code": "sw",787 "resource_type": "tn",788 "resource_code": "tit",789 },790 ],791 },792 )793 finished_document_path = (794 "en-tn-wa-col_sw-tn-col_sw-tn-tit_book_language_order.pdf"795 )796 check_finished_document_with_body_success(response, finished_document_path)797def test_en_ulb_wa_col_sw_ulb_col_sw_ulb_tit_book_language_order() -> None:798 with TestClient(app=app, base_url=settings.api_test_url()) as client:799 response: requests.Response = client.post(800 "/documents",801 json={802 "email_address": settings.TO_EMAIL_ADDRESS,803 "assembly_strategy_kind": "book_language_order",804 "resource_requests": [805 {806 "lang_code": "en",807 "resource_type": "ulb-wa",808 "resource_code": "col",809 },810 {811 "lang_code": "sw",812 "resource_type": "ulb",813 "resource_code": "col",814 },815 {816 "lang_code": "sw",817 "resource_type": "ulb",818 "resource_code": "tit",819 },820 ],821 },822 )823 finished_document_path = (824 "en-ulb-wa-col_sw-ulb-col_sw-ulb-tit_book_language_order.pdf"825 )826 check_finished_document_with_verses_success(response, finished_document_path)827def test_gu_ulb_mrk_gu_tn_mrk_gu_tq_mrk_gu_tw_mrk_gu_udb_mrk_book_language_order() -> None:828 with TestClient(app=app, base_url=settings.api_test_url()) as client:829 response: requests.Response = client.post(830 "/documents",831 json={832 "email_address": settings.TO_EMAIL_ADDRESS,833 "assembly_strategy_kind": "book_language_order",834 "resource_requests": [835 {836 "lang_code": "gu",837 "resource_type": "ulb",838 "resource_code": "mrk",839 },840 {841 "lang_code": "gu",842 "resource_type": "tn",843 "resource_code": "mrk",844 },845 {846 "lang_code": "gu",847 "resource_type": "tq",848 "resource_code": "mrk",849 },850 {851 "lang_code": "gu",852 "resource_type": "tw",853 "resource_code": "mrk",854 },855 {856 "lang_code": "gu",857 "resource_type": "udb",858 "resource_code": "mrk",859 },860 ],861 },862 )863 finished_document_path = "gu-ulb-mrk_gu-tn-mrk_gu-tq-mrk_gu-tw-mrk_gu-udb-mrk_book_language_order.pdf"864 check_finished_document_with_verses_success(response, finished_document_path)865def test_mr_ulb_mrk_mr_tn_mrk_mr_tq_mrk_mr_tw_mrk_mr_udb_mrk_book_language_order() -> None:866 with TestClient(app=app, base_url=settings.api_test_url()) as client:867 response: requests.Response = client.post(868 "/documents",869 json={870 "email_address": settings.TO_EMAIL_ADDRESS,871 "assembly_strategy_kind": "book_language_order",872 "resource_requests": [873 {874 "lang_code": "mr",875 "resource_type": "ulb",876 "resource_code": "mrk",877 },878 {879 "lang_code": "mr",880 "resource_type": "tn",881 "resource_code": "mrk",882 },883 {884 "lang_code": "mr",885 "resource_type": "tq",886 "resource_code": "mrk",887 },888 {889 "lang_code": "mr",890 "resource_type": "tw",891 "resource_code": "mrk",892 },893 {894 "lang_code": "mr",895 "resource_type": "udb",896 "resource_code": "mrk",897 },898 ],899 },900 )901 finished_document_path = "mr-ulb-mrk_mr-tn-mrk_mr-tq-mrk_mr-tw-mrk_mr-udb-mrk_book_language_order.pdf"902 check_finished_document_with_verses_success(response, finished_document_path)903def test_mr_ulb_mrk_mr_tn_mrk_mr_tq_mrk_mr_udb_mrk_book_language_order() -> None:904 with TestClient(app=app, base_url=settings.api_test_url()) as client:905 response: requests.Response = client.post(906 "/documents",907 json={908 "email_address": settings.TO_EMAIL_ADDRESS,909 "assembly_strategy_kind": "book_language_order",910 "resource_requests": [911 {912 "lang_code": "mr",913 "resource_type": "ulb",914 "resource_code": "mrk",915 },916 {917 "lang_code": "mr",918 "resource_type": "tn",919 "resource_code": "mrk",920 },921 {922 "lang_code": "mr",923 "resource_type": "tq",924 "resource_code": "mrk",925 },926 {927 "lang_code": "mr",928 "resource_type": "udb",929 "resource_code": "mrk",930 },931 ],932 },933 )934 finished_document_path = (935 "mr-ulb-mrk_mr-tn-mrk_mr-tq-mrk_mr-udb-mrk_book_language_order.pdf"936 )937 check_finished_document_with_verses_success(response, finished_document_path)938def test_mr_ulb_mrk_mr_tn_mrk_mr_tw_mrk_mr_udb_mrk_book_language_order() -> None:939 with TestClient(app=app, base_url=settings.api_test_url()) as client:940 response: requests.Response = client.post(941 "/documents",942 json={943 "email_address": settings.TO_EMAIL_ADDRESS,944 "assembly_strategy_kind": "book_language_order",945 "resource_requests": [946 {947 "lang_code": "mr",948 "resource_type": "ulb",949 "resource_code": "mrk",950 },951 {952 "lang_code": "mr",953 "resource_type": "tn",954 "resource_code": "mrk",955 },956 {957 "lang_code": "mr",958 "resource_type": "tw",959 "resource_code": "mrk",960 },961 {962 "lang_code": "mr",963 "resource_type": "udb",964 "resource_code": "mrk",965 },966 ],967 },968 )969 finished_document_path = (970 "mr-ulb-mrk_mr-tn-mrk_mr-tw-mrk_mr-udb-mrk_book_language_order.pdf"971 )972 check_finished_document_with_verses_success(response, finished_document_path)973def test_mr_ulb_mrk_mr_tn_mrk_mr_udb_mrk_book_language_order() -> None:974 with TestClient(app=app, base_url=settings.api_test_url()) as client:975 response: requests.Response = client.post(976 "/documents",977 json={978 "email_address": settings.TO_EMAIL_ADDRESS,979 "assembly_strategy_kind": "book_language_order",980 "resource_requests": [981 {982 "lang_code": "mr",983 "resource_type": "ulb",984 "resource_code": "mrk",985 },986 {987 "lang_code": "mr",988 "resource_type": "tn",989 "resource_code": "mrk",990 },991 {992 "lang_code": "mr",993 "resource_type": "udb",994 "resource_code": "mrk",995 },996 ],997 },998 )999 finished_document_path = (1000 "mr-ulb-mrk_mr-tn-mrk_mr-udb-mrk_book_language_order.pdf"1001 )1002 check_finished_document_with_verses_success(response, finished_document_path)1003def test_mr_ulb_mrk_mr_tq_mrk_mr_udb_mrk_book_language_order() -> None:1004 with TestClient(app=app, base_url=settings.api_test_url()) as client:1005 response: requests.Response = client.post(1006 "/documents",1007 json={1008 "email_address": settings.TO_EMAIL_ADDRESS,1009 "assembly_strategy_kind": "book_language_order",1010 "resource_requests": [1011 {1012 "lang_code": "mr",1013 "resource_type": "ulb",1014 "resource_code": "mrk",1015 },1016 {1017 "lang_code": "mr",1018 "resource_type": "tq",1019 "resource_code": "mrk",1020 },1021 {1022 "lang_code": "mr",1023 "resource_type": "udb",1024 "resource_code": "mrk",1025 },1026 ],1027 },1028 )1029 finished_document_path = (1030 "mr-ulb-mrk_mr-tq-mrk_mr-udb-mrk_book_language_order.pdf"1031 )1032 check_finished_document_with_verses_success(response, finished_document_path)1033@pytest.mark.skip1034def test_gu_ulb_mic_gu_tn_mic_gu_tq_mic_gu_tw_mic_gu_ta_mic_book_language_order() -> None:1035 with TestClient(app=app, base_url=settings.api_test_url()) as client:1036 response: requests.Response = client.post(1037 "/documents",1038 json={1039 "email_address": settings.TO_EMAIL_ADDRESS,1040 "assembly_strategy_kind": "book_language_order",1041 "resource_requests": [1042 {1043 "lang_code": "gu",1044 "resource_type": "ulb",1045 "resource_code": "mic",1046 },1047 {1048 "lang_code": "gu",1049 "resource_type": "tn",1050 "resource_code": "mic",1051 },1052 {1053 "lang_code": "gu",1054 "resource_type": "tq",1055 "resource_code": "mic",1056 },1057 {1058 "lang_code": "gu",1059 "resource_type": "tw",1060 "resource_code": "mic",1061 },1062 {1063 "lang_code": "gu",1064 "resource_type": "ta",1065 "resource_code": "mic",1066 },1067 ],1068 },1069 )1070 finished_document_path = (1071 "gu-ulb-mic_gu-tn-mic_gu-tq-mic_gu-tw-mic_gu-ta-mic_book_language_order.pdf"1072 )1073 check_finished_document_with_verses_success(response, finished_document_path)1074def test_tl_ulb_gen_tl_udb_gen_book_language_order() -> None:1075 with TestClient(app=app, base_url=settings.api_test_url()) as client:1076 response: requests.Response = client.post(1077 "/documents",1078 json={1079 "email_address": settings.TO_EMAIL_ADDRESS,1080 "assembly_strategy_kind": "book_language_order",1081 "resource_requests": [1082 {1083 "lang_code": "tl",1084 "resource_type": "ulb",1085 "resource_code": "gen",1086 },1087 {1088 "lang_code": "tl",1089 "resource_type": "udb",1090 "resource_code": "gen",1091 },1092 ],1093 },1094 )1095 finished_document_path = "tl-ulb-gen_tl-udb-gen_book_language_order.pdf"1096 check_finished_document_with_verses_success(response, finished_document_path)1097def test_gu_tn_mat_gu_tq_mat_gu_tw_mat_gu_udb_mat_book_language_order() -> None:1098 with TestClient(app=app, base_url=settings.api_test_url()) as client:1099 response: requests.Response = client.post(1100 "/documents",1101 json={1102 "email_address": settings.TO_EMAIL_ADDRESS,1103 "assembly_strategy_kind": "book_language_order",1104 "resource_requests": [1105 {1106 "lang_code": "gu",1107 "resource_type": "tn",1108 "resource_code": "mat",1109 },1110 {1111 "lang_code": "gu",1112 "resource_type": "tq",1113 "resource_code": "mat",1114 },1115 {1116 "lang_code": "gu",1117 "resource_type": "tw",1118 "resource_code": "mat",1119 },1120 {1121 "lang_code": "gu",1122 "resource_type": "udb",1123 "resource_code": "mat",1124 },1125 ],1126 },1127 )1128 finished_document_path = (1129 "gu-tn-mat_gu-tq-mat_gu-tw-mat_gu-udb-mat_book_language_order.pdf"1130 )1131 check_finished_document_with_verses_success(response, finished_document_path)1132def test_gu_tn_mat_gu_tq_mat_gu_udb_mat_book_language_order() -> None:1133 with TestClient(app=app, base_url=settings.api_test_url()) as client:1134 response: requests.Response = client.post(1135 "/documents",1136 json={1137 "email_address": settings.TO_EMAIL_ADDRESS,1138 "assembly_strategy_kind": "book_language_order",1139 "resource_requests": [1140 {1141 "lang_code": "gu",1142 "resource_type": "tn",1143 "resource_code": "mat",1144 },1145 {1146 "lang_code": "gu",1147 "resource_type": "tq",1148 "resource_code": "mat",1149 },1150 {1151 "lang_code": "gu",1152 "resource_type": "udb",1153 "resource_code": "mat",1154 },1155 ],1156 },1157 )1158 finished_document_path = (1159 "gu-tn-mat_gu-tq-mat_gu-udb-mat_book_language_order.pdf"1160 )1161 check_finished_document_with_verses_success(response, finished_document_path)1162def test_tl_tn_gen_tl_tw_gen_tl_udb_gen_book_language_order() -> None:1163 with TestClient(app=app, base_url=settings.api_test_url()) as client:1164 response: requests.Response = client.post(1165 "/documents",1166 json={1167 "email_address": settings.TO_EMAIL_ADDRESS,1168 "assembly_strategy_kind": "book_language_order",1169 "resource_requests": [1170 {1171 "lang_code": "tl",1172 "resource_type": "tn",1173 "resource_code": "gen",1174 },1175 {1176 "lang_code": "tl",1177 "resource_type": "tw",1178 "resource_code": "gen",1179 },1180 {1181 "lang_code": "tl",1182 "resource_type": "udb",1183 "resource_code": "gen",1184 },1185 ],1186 },1187 )1188 finished_document_path = (1189 "tl-tn-gen_tl-tw-gen_tl-udb-gen_book_language_order.pdf"1190 )1191 check_finished_document_with_verses_success(response, finished_document_path)1192def test_tl_tq_gen_tl_udb_gen_book_language_order() -> None:1193 with TestClient(app=app, base_url=settings.api_test_url()) as client:1194 response: requests.Response = client.post(1195 "/documents",1196 json={1197 "email_address": settings.TO_EMAIL_ADDRESS,1198 "assembly_strategy_kind": "book_language_order",1199 "resource_requests": [1200 {1201 "lang_code": "tl",1202 "resource_type": "tq",1203 "resource_code": "gen",1204 },1205 {1206 "lang_code": "tl",1207 "resource_type": "udb",1208 "resource_code": "gen",1209 },1210 ],1211 },1212 )1213 finished_document_path = "tl-tq-gen_tl-udb-gen_book_language_order.pdf"1214 check_finished_document_with_verses_success(response, finished_document_path)1215def test_tl_tw_gen_tl_udb_gen_book_language_order() -> None:1216 with TestClient(app=app, base_url=settings.api_test_url()) as client:1217 response: requests.Response = client.post(1218 "/documents",1219 json={1220 "email_address": settings.TO_EMAIL_ADDRESS,1221 "assembly_strategy_kind": "book_language_order",1222 "resource_requests": [1223 {1224 "lang_code": "tl",1225 "resource_type": "tw",1226 "resource_code": "gen",1227 },1228 {1229 "lang_code": "tl",1230 "resource_type": "udb",1231 "resource_code": "gen",1232 },1233 ],1234 },1235 )1236 finished_document_path = "tl-tw-gen_tl-udb-gen_book_language_order.pdf"1237 check_finished_document_with_verses_success(response, finished_document_path)1238def test_tl_udb_gen_book_language_order() -> None:1239 with TestClient(app=app, base_url=settings.api_test_url()) as client:1240 response: requests.Response = client.post(1241 "/documents",1242 json={1243 "email_address": settings.TO_EMAIL_ADDRESS,1244 "assembly_strategy_kind": "book_language_order",1245 "resource_requests": [1246 {1247 "lang_code": "tl",1248 "resource_type": "udb",1249 "resource_code": "gen",1250 },1251 ],1252 },1253 )1254 finished_document_path = "tl-udb-gen_book_language_order.pdf"1255 check_finished_document_with_verses_success(response, finished_document_path)1256def test_fr_ulb_rev_fr_tn_rev_fr_tq_rev_fr_tw_rev_fr_udb_rev_book_language_order() -> None:1257 """Demonstrate listing unfound resources, in this case fr-udb-rev"""1258 with TestClient(app=app, base_url=settings.api_test_url()) as client:1259 response: requests.Response = client.post(1260 "/documents",1261 json={1262 "email_address": settings.TO_EMAIL_ADDRESS,1263 "assembly_strategy_kind": "book_language_order",1264 "resource_requests": [1265 {1266 "lang_code": "fr",1267 "resource_type": "ulb",1268 "resource_code": "rev",1269 },1270 {1271 "lang_code": "fr",1272 "resource_type": "tn",1273 "resource_code": "rev",1274 },1275 {1276 "lang_code": "fr",1277 "resource_type": "tq",1278 "resource_code": "rev",1279 },1280 {1281 "lang_code": "fr",1282 "resource_type": "tw",1283 "resource_code": "rev",1284 },1285 {1286 "lang_code": "fr",1287 "resource_type": "udb",1288 "resource_code": "rev",1289 },1290 ],1291 },1292 )1293 finished_document_path = "fr-ulb-rev_fr-tn-rev_fr-tq-rev_fr-tw-rev_fr-udb-rev_book_language_order.pdf"1294 check_finished_document_with_verses_success(response, finished_document_path)1295def test_fr_ulb_rev_fr_tn_rev_fr_tq_rev_fr_tw_rev_fr_f10_rev_book_language_order() -> None:1296 """1297 Demonstrate two USFM resources, French, and use of a special1298 USFM resource: f10.1299 """1300 with TestClient(app=app, base_url=settings.api_test_url()) as client:1301 response: requests.Response = client.post(1302 "/documents",1303 json={1304 "email_address": settings.TO_EMAIL_ADDRESS,1305 "assembly_strategy_kind": "book_language_order",1306 "resource_requests": [1307 {1308 "lang_code": "fr",1309 "resource_type": "ulb",1310 "resource_code": "rev",1311 },1312 {1313 "lang_code": "fr",1314 "resource_type": "tn",1315 "resource_code": "rev",1316 },1317 {1318 "lang_code": "fr",1319 "resource_type": "tq",1320 "resource_code": "rev",1321 },1322 {1323 "lang_code": "fr",1324 "resource_type": "tw",1325 "resource_code": "rev",1326 },1327 {1328 "lang_code": "fr",1329 "resource_type": "f10",1330 "resource_code": "rev",1331 },1332 ],1333 },1334 )1335 finished_document_path = "fr-ulb-rev_fr-tn-rev_fr-tq-rev_fr-tw-rev_fr-f10-rev_book_language_order.pdf"1336 check_finished_document_with_verses_success(response, finished_document_path)1337def test_fr_ulb_rev_fr_tq_rev_fr_tw_rev_fr_f10_rev_book_language_order() -> None:1338 """1339 Demonstrate two USFM resources, French, and use of a special1340 USFM resource: f10.1341 """1342 with TestClient(app=app, base_url=settings.api_test_url()) as client:1343 response: requests.Response = client.post(1344 "/documents",1345 json={1346 "email_address": settings.TO_EMAIL_ADDRESS,1347 "assembly_strategy_kind": "book_language_order",1348 "resource_requests": [1349 {1350 "lang_code": "fr",1351 "resource_type": "ulb",1352 "resource_code": "rev",1353 },1354 {1355 "lang_code": "fr",1356 "resource_type": "tq",1357 "resource_code": "rev",1358 },1359 {1360 "lang_code": "fr",1361 "resource_type": "tw",1362 "resource_code": "rev",1363 },1364 {1365 "lang_code": "fr",1366 "resource_type": "f10",1367 "resource_code": "rev",1368 },1369 ],1370 },1371 )1372 finished_document_path = (1373 "fr-ulb-rev_fr-tq-rev_fr-tw-rev_fr-f10-rev_book_language_order.pdf"1374 )1375 check_finished_document_with_verses_success(response, finished_document_path)1376def test_fr_ulb_rev_fr_tw_rev_fr_udb_rev_book_language_order() -> None:1377 """Demonstrate listing unfound resources, in this case fr-udb-rev"""1378 with TestClient(app=app, base_url=settings.api_test_url()) as client:1379 response: requests.Response = client.post(1380 "/documents",1381 json={1382 "email_address": settings.TO_EMAIL_ADDRESS,1383 "assembly_strategy_kind": "book_language_order",1384 "resource_requests": [1385 {1386 "lang_code": "fr",1387 "resource_type": "ulb",1388 "resource_code": "rev",1389 },1390 {1391 "lang_code": "fr",1392 "resource_type": "tw",1393 "resource_code": "rev",1394 },1395 {1396 "lang_code": "fr",1397 "resource_type": "f10",1398 "resource_code": "rev",1399 },1400 ],1401 },1402 )1403 finished_document_path = (1404 "fr-ulb-rev_fr-tw-rev_fr-f10-rev_book_language_order.pdf"1405 )1406 check_finished_document_with_verses_success(response, finished_document_path)1407def test_ndh_x_chindali_reg_mat_ndh_x_chindali_tn_mat_ndh_x_chindali_tq_mat_ndh_x_chindali_tw_mat_ndh_x_chindali_udb_mat_book_language_order() -> None:1408 with TestClient(app=app, base_url=settings.api_test_url()) as client:1409 response: requests.Response = client.post(1410 "/documents",1411 json={1412 "email_address": settings.TO_EMAIL_ADDRESS,1413 "assembly_strategy_kind": "book_language_order",1414 "resource_requests": [1415 {1416 "lang_code": "ndh-x-chindali",1417 "resource_type": "reg",1418 "resource_code": "mat",1419 },1420 {1421 "lang_code": "ndh-x-chindali",1422 "resource_type": "tn",1423 "resource_code": "mat",1424 },1425 {1426 "lang_code": "ndh-x-chindali",1427 "resource_type": "tq",1428 "resource_code": "mat",1429 },1430 {1431 "lang_code": "ndh-x-chindali",1432 "resource_type": "tw",1433 "resource_code": "mat",1434 },1435 {1436 "lang_code": "ndh-x-chindali",1437 "resource_type": "udb",1438 "resource_code": "mat",1439 },1440 ],1441 },1442 )1443 finished_document_path = "ndh-x-chindali-reg-mat_ndh-x-chindali-tn-mat_ndh-x-chindali-tq-mat_ndh-x-chindali-tw-mat_ndh-x-chindali-udb-mat_book_language_order.pdf"1444 with pytest.raises(Exception):1445 check_finished_document_without_verses_success(1446 response, finished_document_path1447 )1448def test_en_ulb_wa_col_en_tn_wa_col_en_tq_wa_col_en_tw_wa_col_es_419_ulb_col_es_419_tn_col_es_419_tq_col_es_419_tw_col_book_language_order() -> None:1449 with TestClient(app=app, base_url=settings.api_test_url()) as client:1450 response: requests.Response = client.post(1451 "/documents",1452 json={1453 "email_address": settings.TO_EMAIL_ADDRESS,1454 "assembly_strategy_kind": "book_language_order",1455 "resource_requests": [1456 {1457 "lang_code": "en",1458 "resource_type": "ulb-wa",1459 "resource_code": "col",1460 },1461 {1462 "lang_code": "en",1463 "resource_type": "tn-wa",1464 "resource_code": "col",1465 },1466 {1467 "lang_code": "en",1468 "resource_type": "tq-wa",1469 "resource_code": "col",1470 },1471 {1472 "lang_code": "en",1473 "resource_type": "tw-wa",1474 "resource_code": "col",1475 },1476 {1477 "lang_code": "es-419",1478 "resource_type": "ulb",1479 "resource_code": "col",1480 },1481 {1482 "lang_code": "es-419",1483 "resource_type": "tn",1484 "resource_code": "col",1485 },1486 {1487 "lang_code": "es-419",1488 "resource_type": "tq",1489 "resource_code": "col",1490 },1491 {1492 "lang_code": "es-419",1493 "resource_type": "tw",1494 "resource_code": "col",1495 },1496 ],1497 },1498 )1499 finished_document_path = "en-ulb-wa-col_en-tn-wa-col_en-tq-wa-col_en-tw-wa-col_es-419-ulb-col_es-419-tn-col_es-419-tq-col_es-419-tw-col_book_language_order.pdf"1500 check_finished_document_with_verses_success(response, finished_document_path)1501def test_es_ulb_col_es_tn_col_en_tq_col_es_tw_col_book_language_order() -> None:1502 """1503 Ask for a combination of available and unavailable resources.1504 """1505 with TestClient(app=app, base_url=settings.api_test_url()) as client:1506 response: requests.Response = client.post(1507 "/documents",1508 json={1509 "email_address": settings.TO_EMAIL_ADDRESS,1510 "assembly_strategy_kind": "book_language_order",1511 "resource_requests": [1512 {1513 "lang_code": "es",1514 "resource_type": "ulb",1515 "resource_code": "col",1516 },1517 {1518 "lang_code": "es",1519 "resource_type": "tn",1520 "resource_code": "col",1521 },1522 {1523 "lang_code": "es",1524 "resource_type": "tq",1525 "resource_code": "col",1526 },1527 {1528 "lang_code": "es",1529 "resource_type": "tw",1530 "resource_code": "col",1531 },1532 ],1533 },1534 )1535 finished_document_path = (1536 "es-ulb-col_es-tn-col_es-tq-col_es-tw-col_book_language_order.pdf"1537 )1538 check_finished_document_without_verses_success(response, finished_document_path)1539def test_llx_ulb_col_llx_tn_col_en_tq_col_llx_tw_col_book_language_order() -> None:1540 """1541 Ask for an unavailable resource and assert that the verses_html is1542 not generated.1543 """1544 with TestClient(app=app, base_url=settings.api_test_url()) as client:1545 response: requests.Response = client.post(1546 "/documents",1547 json={1548 "email_address": settings.TO_EMAIL_ADDRESS,1549 "assembly_strategy_kind": "book_language_order",1550 "resource_requests": [1551 {1552 "lang_code": "llx",1553 "resource_type": "ulb",1554 "resource_code": "col",1555 },1556 {1557 "lang_code": "llx",1558 "resource_type": "tn",1559 "resource_code": "col",1560 },1561 {1562 "lang_code": "llx",1563 "resource_type": "tq",1564 "resource_code": "col",1565 },1566 {1567 "lang_code": "llx",1568 "resource_type": "tw",1569 "resource_code": "col",1570 },1571 ],1572 },1573 )1574 finished_document_path = (1575 "llx-ulb-col_llx-tn-col_llx-tq-col_llx-tw-col_book_language_order.pdf"1576 )1577 check_finished_document_without_verses_success(response, finished_document_path)1578def test_llx_reg_col_llx_tn_col_en_tq_col_llx_tw_col_book_language_order() -> None:1579 """1580 Ask for an unavailable resource and assert that the verses_html is1581 not generated.1582 """1583 with TestClient(app=app, base_url=settings.api_test_url()) as client:1584 response: requests.Response = client.post(1585 "/documents",1586 json={1587 "email_address": settings.TO_EMAIL_ADDRESS,1588 "assembly_strategy_kind": "book_language_order",1589 "resource_requests": [1590 {1591 "lang_code": "llx",1592 "resource_type": "reg",1593 "resource_code": "col",1594 },1595 {1596 "lang_code": "llx",1597 "resource_type": "tn",1598 "resource_code": "col",1599 },1600 {1601 "lang_code": "llx",1602 "resource_type": "tq",1603 "resource_code": "col",1604 },1605 {1606 "lang_code": "llx",1607 "resource_type": "tw",1608 "resource_code": "col",1609 },1610 ],1611 },1612 )1613 finished_document_path = (1614 "llx-reg-col_llx-tn-col_llx-tq-col_llx-tw-col_book_language_order.pdf"1615 )1616 finished_document_path = os.path.join(1617 settings.output_dir(), finished_document_path1618 )1619 html_file = "{}.html".format(finished_document_path.split(".")[0])1620 assert os.path.exists(finished_document_path)1621 assert os.path.exists(html_file)1622 assert response.ok1623 with open(html_file, "r") as fin:1624 html = fin.read()1625 parser = bs4.BeautifulSoup(html, "html.parser")1626 body: bs4.elements.ResultSet = parser.find_all("body")1627 assert body1628 verses_html: bs4.elements.ResultSet = parser.find_all(1629 "span", attrs={"class": "v-num"}1630 )1631 # Resource requested doesn't exist or isn't available so1632 # we assert that the verses_html was not generated and1633 # thus not present in the document.1634 assert not verses_html1635def test_es_419_ulb_col_es_419_tn_col_en_tq_col_es_419_tw_col_book_language_order() -> None:1636 with TestClient(app=app, base_url=settings.api_test_url()) as client:1637 response: requests.Response = client.post(1638 "/documents",1639 json={1640 "email_address": settings.TO_EMAIL_ADDRESS,1641 "assembly_strategy_kind": "book_language_order",1642 "resource_requests": [1643 {1644 "lang_code": "es-419",1645 "resource_type": "ulb",1646 "resource_code": "col",1647 },1648 {1649 "lang_code": "es-419",1650 "resource_type": "tn",1651 "resource_code": "col",1652 },1653 {1654 "lang_code": "es-419",1655 "resource_type": "tq",1656 "resource_code": "col",1657 },1658 {1659 "lang_code": "es-419",1660 "resource_type": "tw",1661 "resource_code": "col",1662 },1663 ],1664 },1665 )1666 finished_document_path = "es-419-ulb-col_es-419-tn-col_es-419-tq-col_es-419-tw-col_book_language_order.pdf"1667 check_finished_document_with_verses_success(response, finished_document_path)1668def test_es_419_ulb_rom_es_419_tn_rom_en_tq_rom_es_419_tw_rom_book_language_order() -> None:1669 with TestClient(app=app, base_url=settings.api_test_url()) as client:1670 response: requests.Response = client.post(1671 "/documents",1672 json={1673 "email_address": settings.TO_EMAIL_ADDRESS,1674 "assembly_strategy_kind": "book_language_order",1675 "resource_requests": [1676 {1677 "lang_code": "es-419",1678 "resource_type": "ulb",1679 "resource_code": "rom",1680 },1681 {1682 "lang_code": "es-419",1683 "resource_type": "tn",1684 "resource_code": "rom",1685 },1686 {1687 "lang_code": "es-419",1688 "resource_type": "tq",1689 "resource_code": "rom",1690 },1691 {1692 "lang_code": "es-419",1693 "resource_type": "tw",1694 "resource_code": "rom",1695 },1696 ],1697 },1698 )1699 finished_document_path = "es-419-ulb-rom_es-419-tn-rom_es-419-tq-rom_es-419-tw-rom_book_language_order.pdf"1700 check_finished_document_with_verses_success(response, finished_document_path)1701def test_en_ulb_wa_rom_en_tn_wa_rom_en_tq_wa_rom_en_tw_wa_rom_book_language_order() -> None:1702 with TestClient(app=app, base_url=settings.api_test_url()) as client:1703 response: requests.Response = client.post(1704 "/documents",1705 json={1706 "email_address": settings.TO_EMAIL_ADDRESS,1707 "assembly_strategy_kind": "book_language_order",1708 "resource_requests": [1709 {1710 "lang_code": "en",1711 "resource_type": "ulb-wa",1712 "resource_code": "rom",1713 },1714 {1715 "lang_code": "en",1716 "resource_type": "tn-wa",1717 "resource_code": "rom",1718 },1719 {1720 "lang_code": "en",1721 "resource_type": "tq-wa",1722 "resource_code": "rom",1723 },1724 {1725 "lang_code": "en",1726 "resource_type": "tw-wa",1727 "resource_code": "rom",1728 },1729 ],1730 },1731 )1732 finished_document_path = "en-ulb-wa-rom_en-tn-wa-rom_en-tq-wa-rom_en-tw-wa-rom_book_language_order.pdf"1733 check_finished_document_with_verses_success(response, finished_document_path)1734def test_en_ulb_wa_rom_en_tn_wa_rom_en_tq_wa_rom_en_tw_wa_rom_es_419_ulb_rom_es_419_tn_rom_en_tq_rom_es_419_tw_rom_book_language_order() -> None:1735 with TestClient(app=app, base_url=settings.api_test_url()) as client:1736 response: requests.Response = client.post(1737 "/documents",1738 json={1739 "email_address": settings.TO_EMAIL_ADDRESS,1740 "assembly_strategy_kind": "book_language_order",1741 "resource_requests": [1742 {1743 "lang_code": "en",1744 "resource_type": "ulb-wa",1745 "resource_code": "rom",1746 },1747 {1748 "lang_code": "en",1749 "resource_type": "tn-wa",1750 "resource_code": "rom",1751 },1752 {1753 "lang_code": "en",1754 "resource_type": "tq-wa",1755 "resource_code": "rom",1756 },1757 {1758 "lang_code": "en",1759 "resource_type": "tw-wa",1760 "resource_code": "rom",1761 },1762 {1763 "lang_code": "es-419",1764 "resource_type": "ulb",1765 "resource_code": "rom",1766 },1767 {1768 "lang_code": "es-419",1769 "resource_type": "tn",1770 "resource_code": "rom",1771 },1772 {1773 "lang_code": "es-419",1774 "resource_type": "tq",1775 "resource_code": "rom",1776 },1777 {1778 "lang_code": "es-419",1779 "resource_type": "tw",1780 "resource_code": "rom",1781 },1782 ],1783 },1784 )1785 finished_document_path = "en-ulb-wa-rom_en-tn-wa-rom_en-tq-wa-rom_en-tw-wa-rom_es-419-ulb-rom_es-419-tn-rom_es-419-tq-rom_es-419-tw-rom_book_language_order.pdf"1786 check_finished_document_with_verses_success(response, finished_document_path)1787def test_en_ulb_wa_jon_en_tn_wa_jon_en_tq_wa_jon_en_tw_wa_jon_es_419_ulb_rom_es_419_tn_rom_en_tq_rom_es_419_tw_rom_book_language_order() -> None:1788 with TestClient(app=app, base_url=settings.api_test_url()) as client:1789 response: requests.Response = client.post(1790 "/documents",1791 json={1792 "email_address": settings.TO_EMAIL_ADDRESS,1793 "assembly_strategy_kind": "book_language_order",1794 "resource_requests": [1795 {1796 "lang_code": "en",1797 "resource_type": "ulb-wa",1798 "resource_code": "jon",1799 },1800 {1801 "lang_code": "en",1802 "resource_type": "tn-wa",1803 "resource_code": "jon",1804 },1805 {1806 "lang_code": "en",1807 "resource_type": "tq-wa",1808 "resource_code": "jon",1809 },1810 {1811 "lang_code": "en",1812 "resource_type": "tw-wa",1813 "resource_code": "jon",1814 },1815 {1816 "lang_code": "es-419",1817 "resource_type": "ulb",1818 "resource_code": "rom",1819 },1820 {1821 "lang_code": "es-419",1822 "resource_type": "tn",1823 "resource_code": "rom",1824 },1825 {1826 "lang_code": "es-419",1827 "resource_type": "tq",1828 "resource_code": "rom",1829 },1830 {1831 "lang_code": "es-419",1832 "resource_type": "tw",1833 "resource_code": "rom",1834 },1835 ],1836 },1837 )1838 finished_document_path = "en-ulb-wa-jon_en-tn-wa-jon_en-tq-wa-jon_en-tw-wa-jon_es-419-ulb-rom_es-419-tn-rom_es-419-tq-rom_es-419-tw-rom_book_language_order.pdf"1839 check_finished_document_with_verses_success(response, finished_document_path)1840def test_invalid_document_request() -> None:1841 with pytest.raises(Exception):1842 with TestClient(app=app, base_url=settings.api_test_url()) as client:1843 response: requests.Response = client.post(1844 "/documents",1845 json={1846 "email_address": settings.TO_EMAIL_ADDRESS,1847 "assembly_strategy_kind": "book_language_order",1848 "resource_requests": [1849 {1850 "lang_code": "",1851 "resource_type": "xxx",1852 "resource_code": "blah",1853 },1854 ],1855 },1856 )1857 finished_document_path = "invalid_file_that_doesnt_exist.pdf"1858 check_finished_document_with_verses_success(1859 response, finished_document_path...
test_api_assembly_strategy_combinations_lang_then_book.py
Source:test_api_assembly_strategy_combinations_lang_then_book.py
1import os2import pathlib3import re4import bs45import pytest6import requests7from fastapi.testclient import TestClient8from document.config import settings9from document.entrypoints.app import app10def check_finished_document_with_verses_success(11 response: requests.Response, finished_document_path: str12) -> None:13 """14 Helper to keep tests DRY.15 Check that the finished_document_path exists and also check that16 the HTML file associated with it exists and includes verses_html.17 """18 finished_document_path = os.path.join(settings.output_dir(), finished_document_path)19 assert os.path.isfile(finished_document_path)20 html_file = "{}.html".format(finished_document_path.split(".")[0])21 assert os.path.isfile(html_file)22 assert response.json() == {23 "finished_document_request_key": pathlib.Path(finished_document_path).stem,24 "message": settings.SUCCESS_MESSAGE,25 }26 with open(html_file, "r") as fin:27 html = fin.read()28 parser = bs4.BeautifulSoup(html, "html.parser")29 body: bs4.elements.ResultSet = parser.find_all("body")30 assert body31 verses_html: bs4.elements.ResultSet = parser.find_all(32 "span", attrs={"class": "v-num"}33 )34 assert verses_html35 assert response.ok36def check_finished_document_without_verses_success(37 response: requests.Response, finished_document_path: str38) -> None:39 """40 Helper to keep tests DRY.41 Check that the finished_document_path exists and also check that42 the HTML file associated with it exists and includes verses_html.43 """44 finished_document_path = os.path.join(settings.output_dir(), finished_document_path)45 assert os.path.isfile(finished_document_path)46 html_file = "{}.html".format(finished_document_path.split(".")[0])47 assert os.path.isfile(html_file)48 assert response.json() == {49 "finished_document_request_key": pathlib.Path(finished_document_path).stem,50 "message": settings.SUCCESS_MESSAGE,51 }52 with open(html_file, "r") as fin:53 html = fin.read()54 parser = bs4.BeautifulSoup(html, "html.parser")55 body: bs4.elements.ResultSet = parser.find_all("body")56 assert body57 assert response.ok58def test_en_ulb_wa_tit_en_tn_wa_tit_language_book_order() -> None:59 "English ulb-wa and tn-wa for book of Timothy."60 with TestClient(app=app, base_url=settings.api_test_url()) as client:61 response: requests.Response = client.post(62 "/documents",63 json={64 "email_address": settings.TO_EMAIL_ADDRESS,65 "assembly_strategy_kind": "language_book_order",66 "resource_requests": [67 {68 "lang_code": "en",69 "resource_type": "ulb-wa",70 "resource_code": "tit",71 },72 {73 "lang_code": "en",74 "resource_type": "tn-wa",75 "resource_code": "tit",76 },77 ],78 },79 )80 finished_document_path = "en-ulb-wa-tit_en-tn-wa-tit_language_book_order.pdf"81 check_finished_document_with_verses_success(response, finished_document_path)82def test_sw_ulb_col_sw_tn_col_language_book_order() -> None:83 with TestClient(app=app, base_url=settings.api_test_url()) as client:84 response: requests.Response = client.post(85 "/documents",86 json={87 "email_address": settings.TO_EMAIL_ADDRESS,88 "assembly_strategy_kind": "language_book_order",89 "resource_requests": [90 {91 "lang_code": "sw",92 "resource_type": "ulb",93 "resource_code": "col",94 },95 {96 "lang_code": "sw",97 "resource_type": "tn",98 "resource_code": "col",99 },100 ],101 },102 )103 finished_document_path = "sw-ulb-col_sw-tn-col_language_book_order.pdf"104 check_finished_document_with_verses_success(response, finished_document_path)105def test_sw_ulb_col_sw_tn_col_sw_ulb_tit_sw_tn_tit_language_book_order() -> None:106 with TestClient(app=app, base_url=settings.api_test_url()) as client:107 response: requests.Response = client.post(108 "/documents",109 json={110 "email_address": settings.TO_EMAIL_ADDRESS,111 "assembly_strategy_kind": "language_book_order",112 "resource_requests": [113 {114 "lang_code": "sw",115 "resource_type": "ulb",116 "resource_code": "col",117 },118 {119 "lang_code": "sw",120 "resource_type": "tn",121 "resource_code": "col",122 },123 {124 "lang_code": "sw",125 "resource_type": "ulb",126 "resource_code": "tit",127 },128 {129 "lang_code": "sw",130 "resource_type": "tn",131 "resource_code": "tit",132 },133 ],134 },135 )136 finished_document_path = (137 "sw-ulb-col_sw-tn-col_sw-ulb-tit_sw-tn-tit_language_book_order.pdf"138 )139 check_finished_document_with_verses_success(response, finished_document_path)140def test_en_ulb_wa_col_en_tn_wa_col_sw_ulb_col_sw_tn_col_sw_ulb_tit_sw_tn_tit_language_book_order() -> None:141 with TestClient(app=app, base_url=settings.api_test_url()) as client:142 response: requests.Response = client.post(143 "/documents",144 json={145 "email_address": settings.TO_EMAIL_ADDRESS,146 "assembly_strategy_kind": "language_book_order",147 "resource_requests": [148 {149 "lang_code": "en",150 "resource_type": "ulb-wa",151 "resource_code": "col",152 },153 {154 "lang_code": "en",155 "resource_type": "tn-wa",156 "resource_code": "col",157 },158 {159 "lang_code": "sw",160 "resource_type": "ulb",161 "resource_code": "col",162 },163 {164 "lang_code": "sw",165 "resource_type": "tn",166 "resource_code": "col",167 },168 {169 "lang_code": "sw",170 "resource_type": "ulb",171 "resource_code": "tit",172 },173 {174 "lang_code": "sw",175 "resource_type": "tn",176 "resource_code": "tit",177 },178 ],179 },180 )181 finished_document_path = "en-ulb-wa-col_en-tn-wa-col_sw-ulb-col_sw-tn-col_sw-ulb-tit_sw-tn-tit_language_book_order.pdf"182 check_finished_document_with_verses_success(response, finished_document_path)183def test_en_ulb_wa_col_en_tn_wa_col_en_tq_wa_col_sw_ulb_col_sw_tn_col_sw_tq_col_sw_ulb_tit_sw_tn_tit_sw_tq_tit_language_book_order() -> None:184 with TestClient(app=app, base_url=settings.api_test_url()) as client:185 response: requests.Response = client.post(186 "/documents",187 json={188 "email_address": settings.TO_EMAIL_ADDRESS,189 "assembly_strategy_kind": "language_book_order",190 "resource_requests": [191 {192 "lang_code": "en",193 "resource_type": "ulb-wa",194 "resource_code": "col",195 },196 {197 "lang_code": "en",198 "resource_type": "tn-wa",199 "resource_code": "col",200 },201 {202 "lang_code": "en",203 "resource_type": "tq-wa",204 "resource_code": "col",205 },206 {207 "lang_code": "sw",208 "resource_type": "ulb",209 "resource_code": "col",210 },211 {212 "lang_code": "sw",213 "resource_type": "tn",214 "resource_code": "col",215 },216 {217 "lang_code": "sw",218 "resource_type": "tq",219 "resource_code": "col",220 },221 {222 "lang_code": "sw",223 "resource_type": "ulb",224 "resource_code": "tit",225 },226 {227 "lang_code": "sw",228 "resource_type": "tn",229 "resource_code": "tit",230 },231 {232 "lang_code": "sw",233 "resource_type": "tq",234 "resource_code": "tit",235 },236 ],237 },238 )239 finished_document_path = "en-ulb-wa-col_en-tn-wa-col_en-tq-wa-col_sw-ulb-col_sw-tn-col_sw-tq-col_sw-ulb-tit_sw-tn-tit_sw-tq-tit_language_book_order.pdf"240 check_finished_document_with_verses_success(response, finished_document_path)241def test_en_ulb_wa_col_en_tq_wa_col_sw_ulb_col_sw_tq_col_sw_ulb_tit_sw_tq_tit_language_book_order() -> None:242 with TestClient(app=app, base_url=settings.api_test_url()) as client:243 response: requests.Response = client.post(244 "/documents",245 json={246 "email_address": settings.TO_EMAIL_ADDRESS,247 "assembly_strategy_kind": "language_book_order",248 "resource_requests": [249 {250 "lang_code": "en",251 "resource_type": "ulb-wa",252 "resource_code": "col",253 },254 {255 "lang_code": "en",256 "resource_type": "tq-wa",257 "resource_code": "col",258 },259 {260 "lang_code": "sw",261 "resource_type": "ulb",262 "resource_code": "col",263 },264 {265 "lang_code": "sw",266 "resource_type": "tq",267 "resource_code": "col",268 },269 {270 "lang_code": "sw",271 "resource_type": "ulb",272 "resource_code": "tit",273 },274 {275 "lang_code": "sw",276 "resource_type": "tq",277 "resource_code": "tit",278 },279 ],280 },281 )282 finished_document_path = "en-ulb-wa-col_en-tq-wa-col_sw-ulb-col_sw-tq-col_sw-ulb-tit_sw-tq-tit_language_book_order.pdf"283 check_finished_document_with_verses_success(response, finished_document_path)284def test_en_tn_wa_col_en_tq_wa_col_en_tw_wa_col_sw_tn_col_sw_tq_col_sw_tw_col_sw_tn_tit_sw_tq_tit_sw_tw_tit_language_book_order() -> None:285 with TestClient(app=app, base_url=settings.api_test_url()) as client:286 response: requests.Response = client.post(287 "/documents",288 json={289 "email_address": settings.TO_EMAIL_ADDRESS,290 "assembly_strategy_kind": "language_book_order",291 "resource_requests": [292 {293 "lang_code": "en",294 "resource_type": "tn-wa",295 "resource_code": "col",296 },297 {298 "lang_code": "en",299 "resource_type": "tq-wa",300 "resource_code": "col",301 },302 {303 "lang_code": "en",304 "resource_type": "tw-wa",305 "resource_code": "col",306 },307 {308 "lang_code": "sw",309 "resource_type": "tn",310 "resource_code": "col",311 },312 {313 "lang_code": "sw",314 "resource_type": "tq",315 "resource_code": "col",316 },317 {318 "lang_code": "sw",319 "resource_type": "tw",320 "resource_code": "col",321 },322 {323 "lang_code": "sw",324 "resource_type": "tn",325 "resource_code": "tit",326 },327 {328 "lang_code": "sw",329 "resource_type": "tq",330 "resource_code": "tit",331 },332 {333 "lang_code": "sw",334 "resource_type": "tw",335 "resource_code": "tit",336 },337 ],338 },339 )340 finished_document_path = "en-tn-wa-col_en-tq-wa-col_en-tw-wa-col_sw-tn-col_sw-tq-col_sw-tw-col_sw-tn-tit_sw-tq-tit_sw-tw-tit_language_book_order.pdf"341 check_finished_document_without_verses_success(response, finished_document_path)342def test_en_tn_wa_col_en_tw_wa_col_sw_tn_col_sw_tw_col_sw_tn_tit_sw_tw_tit_language_book_order() -> None:343 with TestClient(app=app, base_url=settings.api_test_url()) as client:344 response: requests.Response = client.post(345 "/documents",346 json={347 "email_address": settings.TO_EMAIL_ADDRESS,348 "assembly_strategy_kind": "language_book_order",349 "resource_requests": [350 {351 "lang_code": "en",352 "resource_type": "tn-wa",353 "resource_code": "col",354 },355 {356 "lang_code": "en",357 "resource_type": "tw-wa",358 "resource_code": "col",359 },360 {361 "lang_code": "sw",362 "resource_type": "tn",363 "resource_code": "col",364 },365 {366 "lang_code": "sw",367 "resource_type": "tw",368 "resource_code": "col",369 },370 {371 "lang_code": "sw",372 "resource_type": "tn",373 "resource_code": "tit",374 },375 {376 "lang_code": "sw",377 "resource_type": "tw",378 "resource_code": "tit",379 },380 ],381 },382 )383 finished_document_path = "en-tn-wa-col_en-tw-wa-col_sw-tn-col_sw-tw-col_sw-tn-tit_sw-tw-tit_language_book_order.pdf"384 check_finished_document_without_verses_success(response, finished_document_path)385def test_en_tq_wa_col_en_tw_wa_col_sw_tq_col_sw_tw_col_sw_tq_tit_sw_tw_tit_language_book_order() -> None:386 with TestClient(app=app, base_url=settings.api_test_url()) as client:387 response: requests.Response = client.post(388 "/documents",389 json={390 "email_address": settings.TO_EMAIL_ADDRESS,391 "assembly_strategy_kind": "language_book_order",392 "resource_requests": [393 {394 "lang_code": "en",395 "resource_type": "tq-wa",396 "resource_code": "col",397 },398 {399 "lang_code": "en",400 "resource_type": "tw-wa",401 "resource_code": "col",402 },403 {404 "lang_code": "sw",405 "resource_type": "tq",406 "resource_code": "col",407 },408 {409 "lang_code": "sw",410 "resource_type": "tw",411 "resource_code": "col",412 },413 ],414 },415 )416 finished_document_path = (417 "en-tq-wa-col_en-tw-wa-col_sw-tq-col_sw-tw-col_language_book_order.pdf"418 )419 check_finished_document_without_verses_success(response, finished_document_path)420def test_en_tw_wa_col_sw_tw_col_sw_tw_tit_language_book_order() -> None:421 with TestClient(app=app, base_url=settings.api_test_url()) as client:422 response: requests.Response = client.post(423 "/documents",424 json={425 "email_address": settings.TO_EMAIL_ADDRESS,426 "assembly_strategy_kind": "language_book_order",427 "resource_requests": [428 {429 "lang_code": "en",430 "resource_type": "tw-wa",431 "resource_code": "col",432 },433 {434 "lang_code": "sw",435 "resource_type": "tw",436 "resource_code": "col",437 },438 ],439 },440 )441 finished_document_path = "en-tw-wa-col_sw-tw-col_language_book_order.pdf"442 check_finished_document_without_verses_success(response, finished_document_path)443def test_en_tn_wa_col_en_tq_wa_col_sw_tn_col_sw_tq_col_sw_tn_tit_sw_tq_tit_language_book_order() -> None:444 with TestClient(app=app, base_url=settings.api_test_url()) as client:445 response: requests.Response = client.post(446 "/documents",447 json={448 "email_address": settings.TO_EMAIL_ADDRESS,449 "assembly_strategy_kind": "language_book_order",450 "resource_requests": [451 {452 "lang_code": "en",453 "resource_type": "tn-wa",454 "resource_code": "col",455 },456 {457 "lang_code": "en",458 "resource_type": "tq-wa",459 "resource_code": "col",460 },461 {462 "lang_code": "sw",463 "resource_type": "tn",464 "resource_code": "col",465 },466 {467 "lang_code": "sw",468 "resource_type": "tq",469 "resource_code": "col",470 },471 ],472 },473 )474 finished_document_path = (475 "en-tn-wa-col_en-tq-wa-col_sw-tn-col_sw-tq-col_language_book_order.pdf"476 )477 check_finished_document_without_verses_success(response, finished_document_path)478def test_en_tq_wa_col_sw_tq_col_sw_tq_tit_language_book_order() -> None:479 with TestClient(app=app, base_url=settings.api_test_url()) as client:480 response: requests.Response = client.post(481 "/documents",482 json={483 "email_address": settings.TO_EMAIL_ADDRESS,484 "assembly_strategy_kind": "language_book_order",485 "resource_requests": [486 {487 "lang_code": "en",488 "resource_type": "tq-wa",489 "resource_code": "col",490 },491 {492 "lang_code": "sw",493 "resource_type": "tq",494 "resource_code": "col",495 },496 ],497 },498 )499 finished_document_path = "en-tq-wa-col_sw-tq-col_language_book_order.pdf"500 check_finished_document_without_verses_success(response, finished_document_path)501def test_en_tn_wa_col_sw_tn_col_sw_tn_tit_language_book_order() -> None:502 with TestClient(app=app, base_url=settings.api_test_url()) as client:503 response: requests.Response = client.post(504 "/documents",505 json={506 "email_address": settings.TO_EMAIL_ADDRESS,507 "assembly_strategy_kind": "language_book_order",508 "resource_requests": [509 {510 "lang_code": "en",511 "resource_type": "tn-wa",512 "resource_code": "col",513 },514 {515 "lang_code": "sw",516 "resource_type": "tn",517 "resource_code": "col",518 },519 {520 "lang_code": "sw",521 "resource_type": "tn",522 "resource_code": "tit",523 },524 ],525 },526 )527 finished_document_path = (528 "en-tn-wa-col_sw-tn-col_sw-tn-tit_language_book_order.pdf"529 )530 check_finished_document_without_verses_success(response, finished_document_path)531def test_en_ulb_wa_col_sw_ulb_col_sw_ulb_tit_language_book_order() -> None:532 with TestClient(app=app, base_url=settings.api_test_url()) as client:533 response: requests.Response = client.post(534 "/documents",535 json={536 "email_address": settings.TO_EMAIL_ADDRESS,537 "assembly_strategy_kind": "language_book_order",538 "resource_requests": [539 {540 "lang_code": "en",541 "resource_type": "ulb-wa",542 "resource_code": "col",543 },544 {545 "lang_code": "sw",546 "resource_type": "ulb",547 "resource_code": "col",548 },549 {550 "lang_code": "sw",551 "resource_type": "ulb",552 "resource_code": "tit",553 },554 ],555 },556 )557 finished_document_path = (558 "en-ulb-wa-col_sw-ulb-col_sw-ulb-tit_language_book_order.pdf"559 )560 check_finished_document_with_verses_success(response, finished_document_path)561def test_gu_ulb_mrk_gu_tn_mrk_gu_tq_mrk_gu_tw_mrk_gu_udb_mrk_language_book_order() -> None:562 with TestClient(app=app, base_url=settings.api_test_url()) as client:563 response: requests.Response = client.post(564 "/documents",565 json={566 "email_address": settings.TO_EMAIL_ADDRESS,567 "assembly_strategy_kind": "language_book_order",568 "resource_requests": [569 {570 "lang_code": "gu",571 "resource_type": "ulb",572 "resource_code": "mrk",573 },574 {575 "lang_code": "gu",576 "resource_type": "tn",577 "resource_code": "mrk",578 },579 {580 "lang_code": "gu",581 "resource_type": "tq",582 "resource_code": "mrk",583 },584 {585 "lang_code": "gu",586 "resource_type": "tw",587 "resource_code": "mrk",588 },589 {590 "lang_code": "gu",591 "resource_type": "udb",592 "resource_code": "mrk",593 },594 ],595 },596 )597 finished_document_path = "gu-ulb-mrk_gu-tn-mrk_gu-tq-mrk_gu-tw-mrk_gu-udb-mrk_language_book_order.pdf"598 check_finished_document_with_verses_success(response, finished_document_path)599def test_mr_ulb_mrk_mr_tn_mrk_mr_tq_mrk_mr_tw_mrk_mr_udb_mrk_language_book_order() -> None:600 with TestClient(app=app, base_url=settings.api_test_url()) as client:601 response: requests.Response = client.post(602 "/documents",603 json={604 "email_address": settings.TO_EMAIL_ADDRESS,605 "assembly_strategy_kind": "language_book_order",606 "resource_requests": [607 {608 "lang_code": "mr",609 "resource_type": "ulb",610 "resource_code": "mrk",611 },612 {613 "lang_code": "mr",614 "resource_type": "tn",615 "resource_code": "mrk",616 },617 {618 "lang_code": "mr",619 "resource_type": "tq",620 "resource_code": "mrk",621 },622 {623 "lang_code": "mr",624 "resource_type": "tw",625 "resource_code": "mrk",626 },627 {628 "lang_code": "mr",629 "resource_type": "udb",630 "resource_code": "mrk",631 },632 ],633 },634 )635 finished_document_path = "mr-ulb-mrk_mr-tn-mrk_mr-tq-mrk_mr-tw-mrk_mr-udb-mrk_language_book_order.pdf"636 check_finished_document_with_verses_success(response, finished_document_path)637def test_mr_ulb_mrk_mr_tn_mrk_mr_tq_mrk_mr_udb_mrk_language_book_order() -> None:638 with TestClient(app=app, base_url=settings.api_test_url()) as client:639 response: requests.Response = client.post(640 "/documents",641 json={642 "email_address": settings.TO_EMAIL_ADDRESS,643 "assembly_strategy_kind": "language_book_order",644 "resource_requests": [645 {646 "lang_code": "mr",647 "resource_type": "ulb",648 "resource_code": "mrk",649 },650 {651 "lang_code": "mr",652 "resource_type": "tn",653 "resource_code": "mrk",654 },655 {656 "lang_code": "mr",657 "resource_type": "tq",658 "resource_code": "mrk",659 },660 {661 "lang_code": "mr",662 "resource_type": "udb",663 "resource_code": "mrk",664 },665 ],666 },667 )668 finished_document_path = (669 "mr-ulb-mrk_mr-tn-mrk_mr-tq-mrk_mr-udb-mrk_language_book_order.pdf"670 )671 check_finished_document_with_verses_success(response, finished_document_path)672def test_mr_ulb_mrk_mr_tn_mrk_mr_tw_mrk_mr_udb_mrk_language_book_order() -> None:673 with TestClient(app=app, base_url=settings.api_test_url()) as client:674 response: requests.Response = client.post(675 "/documents",676 json={677 "email_address": settings.TO_EMAIL_ADDRESS,678 "assembly_strategy_kind": "language_book_order",679 "resource_requests": [680 {681 "lang_code": "mr",682 "resource_type": "ulb",683 "resource_code": "mrk",684 },685 {686 "lang_code": "mr",687 "resource_type": "tn",688 "resource_code": "mrk",689 },690 {691 "lang_code": "mr",692 "resource_type": "tw",693 "resource_code": "mrk",694 },695 {696 "lang_code": "mr",697 "resource_type": "udb",698 "resource_code": "mrk",699 },700 ],701 },702 )703 finished_document_path = (704 "mr-ulb-mrk_mr-tn-mrk_mr-tw-mrk_mr-udb-mrk_language_book_order.pdf"705 )706 check_finished_document_with_verses_success(response, finished_document_path)707def test_mr_ulb_mrk_mr_tn_mrk_mr_udb_mrk_language_book_order() -> None:708 with TestClient(app=app, base_url=settings.api_test_url()) as client:709 response: requests.Response = client.post(710 "/documents",711 json={712 "email_address": settings.TO_EMAIL_ADDRESS,713 "assembly_strategy_kind": "language_book_order",714 "resource_requests": [715 {716 "lang_code": "mr",717 "resource_type": "ulb",718 "resource_code": "mrk",719 },720 {721 "lang_code": "mr",722 "resource_type": "tn",723 "resource_code": "mrk",724 },725 {726 "lang_code": "mr",727 "resource_type": "udb",728 "resource_code": "mrk",729 },730 ],731 },732 )733 finished_document_path = (734 "mr-ulb-mrk_mr-tn-mrk_mr-udb-mrk_language_book_order.pdf"735 )736 check_finished_document_with_verses_success(response, finished_document_path)737def test_mr_ulb_mrk_mr_tq_mrk_mr_udb_mrk_language_book_order() -> None:738 with TestClient(app=app, base_url=settings.api_test_url()) as client:739 response: requests.Response = client.post(740 "/documents",741 json={742 "email_address": settings.TO_EMAIL_ADDRESS,743 "assembly_strategy_kind": "language_book_order",744 "resource_requests": [745 {746 "lang_code": "mr",747 "resource_type": "ulb",748 "resource_code": "mrk",749 },750 {751 "lang_code": "mr",752 "resource_type": "tq",753 "resource_code": "mrk",754 },755 {756 "lang_code": "mr",757 "resource_type": "udb",758 "resource_code": "mrk",759 },760 ],761 },762 )763 finished_document_path = (764 "mr-ulb-mrk_mr-tq-mrk_mr-udb-mrk_language_book_order.pdf"765 )766 check_finished_document_with_verses_success(response, finished_document_path)767@pytest.mark.skip768def test_gu_ulb_mic_gu_tn_mic_gu_tq_mic_gu_tw_mic_gu_ta_mic_language_book_order() -> None:769 with TestClient(app=app, base_url=settings.api_test_url()) as client:770 response: requests.Response = client.post(771 "/documents",772 json={773 "email_address": settings.TO_EMAIL_ADDRESS,774 "assembly_strategy_kind": "language_book_order",775 "resource_requests": [776 {777 "lang_code": "gu",778 "resource_type": "ulb",779 "resource_code": "mic",780 },781 {782 "lang_code": "gu",783 "resource_type": "tn",784 "resource_code": "mic",785 },786 {787 "lang_code": "gu",788 "resource_type": "tq",789 "resource_code": "mic",790 },791 {792 "lang_code": "gu",793 "resource_type": "tw",794 "resource_code": "mic",795 },796 {797 "lang_code": "gu",798 "resource_type": "ta",799 "resource_code": "mic",800 },801 ],802 },803 )804 finished_document_path = (805 "gu-ulb-mic_gu-tn-mic_gu-tq-mic_gu-tw-mic_gu-ta-mic_language_book_order.pdf"806 )807 check_finished_document_with_verses_success(response, finished_document_path)808def test_tl_ulb_gen_tl_udb_gen_language_book_order() -> None:809 with TestClient(app=app, base_url=settings.api_test_url()) as client:810 response: requests.Response = client.post(811 "/documents",812 json={813 "email_address": settings.TO_EMAIL_ADDRESS,814 "assembly_strategy_kind": "language_book_order",815 "resource_requests": [816 {817 "lang_code": "tl",818 "resource_type": "ulb",819 "resource_code": "gen",820 },821 {822 "lang_code": "tl",823 "resource_type": "udb",824 "resource_code": "gen",825 },826 ],827 },828 )829 finished_document_path = "tl-ulb-gen_tl-udb-gen_language_book_order.pdf"830 check_finished_document_with_verses_success(response, finished_document_path)831def test_gu_tn_mat_gu_tq_mat_gu_tw_mat_gu_udb_mat_language_book_order() -> None:832 with TestClient(app=app, base_url=settings.api_test_url()) as client:833 response: requests.Response = client.post(834 "/documents",835 json={836 "email_address": settings.TO_EMAIL_ADDRESS,837 "assembly_strategy_kind": "language_book_order",838 "resource_requests": [839 {840 "lang_code": "gu",841 "resource_type": "tn",842 "resource_code": "mat",843 },844 {845 "lang_code": "gu",846 "resource_type": "tq",847 "resource_code": "mat",848 },849 {850 "lang_code": "gu",851 "resource_type": "tw",852 "resource_code": "mat",853 },854 {855 "lang_code": "gu",856 "resource_type": "udb",857 "resource_code": "mat",858 },859 ],860 },861 )862 finished_document_path = (863 "gu-tn-mat_gu-tq-mat_gu-tw-mat_gu-udb-mat_language_book_order.pdf"864 )865 check_finished_document_with_verses_success(response, finished_document_path)866def test_gu_tn_mat_gu_tq_mat_gu_udb_mat_language_book_order() -> None:867 with TestClient(app=app, base_url=settings.api_test_url()) as client:868 response: requests.Response = client.post(869 "/documents",870 json={871 "email_address": settings.TO_EMAIL_ADDRESS,872 "assembly_strategy_kind": "language_book_order",873 "resource_requests": [874 {875 "lang_code": "gu",876 "resource_type": "tn",877 "resource_code": "mat",878 },879 {880 "lang_code": "gu",881 "resource_type": "tq",882 "resource_code": "mat",883 },884 {885 "lang_code": "gu",886 "resource_type": "udb",887 "resource_code": "mat",888 },889 ],890 },891 )892 finished_document_path = (893 "gu-tn-mat_gu-tq-mat_gu-udb-mat_language_book_order.pdf"894 )895 check_finished_document_with_verses_success(response, finished_document_path)896def test_tl_tn_gen_tl_tw_gen_tl_udb_gen_language_book_order() -> None:897 with TestClient(app=app, base_url=settings.api_test_url()) as client:898 response: requests.Response = client.post(899 "/documents",900 json={901 "email_address": settings.TO_EMAIL_ADDRESS,902 "assembly_strategy_kind": "language_book_order",903 "resource_requests": [904 {905 "lang_code": "tl",906 "resource_type": "tn",907 "resource_code": "gen",908 },909 {910 "lang_code": "tl",911 "resource_type": "tw",912 "resource_code": "gen",913 },914 {915 "lang_code": "tl",916 "resource_type": "udb",917 "resource_code": "gen",918 },919 ],920 },921 )922 finished_document_path = (923 "tl-tn-gen_tl-tw-gen_tl-udb-gen_language_book_order.pdf"924 )925 check_finished_document_with_verses_success(response, finished_document_path)926def test_tl_tq_gen_tl_udb_gen_language_book_order() -> None:927 with TestClient(app=app, base_url=settings.api_test_url()) as client:928 response: requests.Response = client.post(929 "/documents",930 json={931 "email_address": settings.TO_EMAIL_ADDRESS,932 "assembly_strategy_kind": "language_book_order",933 "resource_requests": [934 {935 "lang_code": "tl",936 "resource_type": "tq",937 "resource_code": "gen",938 },939 {940 "lang_code": "tl",941 "resource_type": "udb",942 "resource_code": "gen",943 },944 ],945 },946 )947 finished_document_path = "tl-tq-gen_tl-udb-gen_language_book_order.pdf"948 check_finished_document_with_verses_success(response, finished_document_path)949def test_tl_tw_gen_tl_udb_gen_language_book_order() -> None:950 with TestClient(app=app, base_url=settings.api_test_url()) as client:951 response: requests.Response = client.post(952 "/documents",953 json={954 "email_address": settings.TO_EMAIL_ADDRESS,955 "assembly_strategy_kind": "language_book_order",956 "resource_requests": [957 {958 "lang_code": "tl",959 "resource_type": "tw",960 "resource_code": "gen",961 },962 {963 "lang_code": "tl",964 "resource_type": "udb",965 "resource_code": "gen",966 },967 ],968 },969 )970 finished_document_path = "tl-tw-gen_tl-udb-gen_language_book_order.pdf"971 check_finished_document_with_verses_success(response, finished_document_path)972def test_tl_udb_gen_language_book_order() -> None:973 with TestClient(app=app, base_url=settings.api_test_url()) as client:974 response: requests.Response = client.post(975 "/documents",976 json={977 "email_address": settings.TO_EMAIL_ADDRESS,978 "assembly_strategy_kind": "language_book_order",979 "resource_requests": [980 {981 "lang_code": "tl",982 "resource_type": "udb",983 "resource_code": "gen",984 },985 ],986 },987 )988 finished_document_path = "tl-udb-gen_language_book_order.pdf"989 check_finished_document_with_verses_success(response, finished_document_path)990def test_fr_ulb_rev_fr_tn_rev_fr_tq_rev_fr_tw_rev_fr_udb_rev_language_book_order() -> None:991 """Demonstrate listing unfound resources, in this case fr-udb-rev"""992 with TestClient(app=app, base_url=settings.api_test_url()) as client:993 response: requests.Response = client.post(994 "/documents",995 json={996 "email_address": settings.TO_EMAIL_ADDRESS,997 "assembly_strategy_kind": "language_book_order",998 "resource_requests": [999 {1000 "lang_code": "fr",1001 "resource_type": "ulb",1002 "resource_code": "rev",1003 },1004 {1005 "lang_code": "fr",1006 "resource_type": "tn",1007 "resource_code": "rev",1008 },1009 {1010 "lang_code": "fr",1011 "resource_type": "tq",1012 "resource_code": "rev",1013 },1014 {1015 "lang_code": "fr",1016 "resource_type": "tw",1017 "resource_code": "rev",1018 },1019 {1020 "lang_code": "fr",1021 "resource_type": "udb",1022 "resource_code": "rev",1023 },1024 ],1025 },1026 )1027 finished_document_path = "fr-ulb-rev_fr-tn-rev_fr-tq-rev_fr-tw-rev_fr-udb-rev_language_book_order.pdf"1028 check_finished_document_with_verses_success(response, finished_document_path)1029def test_fr_ulb_rev_fr_tn_rev_fr_tq_rev_fr_tw_rev_fr_f10_rev_language_book_order() -> None:1030 """1031 Demonstrate two USFM resources, French, and use of a special1032 USFM resource: f10.1033 """1034 with TestClient(app=app, base_url=settings.api_test_url()) as client:1035 response: requests.Response = client.post(1036 "/documents",1037 json={1038 "email_address": settings.TO_EMAIL_ADDRESS,1039 "assembly_strategy_kind": "language_book_order",1040 "resource_requests": [1041 {1042 "lang_code": "fr",1043 "resource_type": "ulb",1044 "resource_code": "rev",1045 },1046 {1047 "lang_code": "fr",1048 "resource_type": "tn",1049 "resource_code": "rev",1050 },1051 {1052 "lang_code": "fr",1053 "resource_type": "tq",1054 "resource_code": "rev",1055 },1056 {1057 "lang_code": "fr",1058 "resource_type": "tw",1059 "resource_code": "rev",1060 },1061 {1062 "lang_code": "fr",1063 "resource_type": "f10",1064 "resource_code": "rev",1065 },1066 ],1067 },1068 )1069 finished_document_path = "fr-ulb-rev_fr-tn-rev_fr-tq-rev_fr-tw-rev_fr-f10-rev_language_book_order.pdf"1070 check_finished_document_with_verses_success(response, finished_document_path)1071def test_fr_ulb_rev_fr_tq_rev_fr_tw_rev_fr_f10_rev_language_book_order() -> None:1072 """1073 Demonstrate two USFM resources, French, and use of a special1074 USFM resource: f10.1075 """1076 with TestClient(app=app, base_url=settings.api_test_url()) as client:1077 response: requests.Response = client.post(1078 "/documents",1079 json={1080 "email_address": settings.TO_EMAIL_ADDRESS,1081 "assembly_strategy_kind": "language_book_order",1082 "resource_requests": [1083 {1084 "lang_code": "fr",1085 "resource_type": "ulb",1086 "resource_code": "rev",1087 },1088 {1089 "lang_code": "fr",1090 "resource_type": "tq",1091 "resource_code": "rev",1092 },1093 {1094 "lang_code": "fr",1095 "resource_type": "tw",1096 "resource_code": "rev",1097 },1098 {1099 "lang_code": "fr",1100 "resource_type": "f10",1101 "resource_code": "rev",1102 },1103 ],1104 },1105 )1106 finished_document_path = (1107 "fr-ulb-rev_fr-tq-rev_fr-tw-rev_fr-f10-rev_language_book_order.pdf"1108 )1109 check_finished_document_with_verses_success(response, finished_document_path)1110def test_fr_ulb_rev_fr_tw_rev_fr_udb_rev_language_book_order() -> None:1111 """Demonstrate listing unfound resources, in this case fr-udb-rev"""1112 with TestClient(app=app, base_url=settings.api_test_url()) as client:1113 response: requests.Response = client.post(1114 "/documents",1115 json={1116 "email_address": settings.TO_EMAIL_ADDRESS,1117 "assembly_strategy_kind": "language_book_order",1118 "resource_requests": [1119 {1120 "lang_code": "fr",1121 "resource_type": "ulb",1122 "resource_code": "rev",1123 },1124 {1125 "lang_code": "fr",1126 "resource_type": "tw",1127 "resource_code": "rev",1128 },1129 {1130 "lang_code": "fr",1131 "resource_type": "f10",1132 "resource_code": "rev",1133 },1134 ],1135 },1136 )1137 finished_document_path = (1138 "fr-ulb-rev_fr-tw-rev_fr-f10-rev_language_book_order.pdf"1139 )1140 check_finished_document_with_verses_success(response, finished_document_path)1141def test_en_ulb_wa_col_en_tn_wa_col_en_tq_wa_col_en_tw_wa_col_es_419_ulb_col_es_419_tn_col_es_419_tq_col_es_419_tw_col_language_book_order() -> None:1142 with TestClient(app=app, base_url=settings.api_test_url()) as client:1143 response: requests.Response = client.post(1144 "/documents",1145 json={1146 "email_address": settings.TO_EMAIL_ADDRESS,1147 "assembly_strategy_kind": "language_book_order",1148 "resource_requests": [1149 {1150 "lang_code": "en",1151 "resource_type": "ulb-wa",1152 "resource_code": "col",1153 },1154 {1155 "lang_code": "en",1156 "resource_type": "tn-wa",1157 "resource_code": "col",1158 },1159 {1160 "lang_code": "en",1161 "resource_type": "tq-wa",1162 "resource_code": "col",1163 },1164 {1165 "lang_code": "en",1166 "resource_type": "tw-wa",1167 "resource_code": "col",1168 },1169 {1170 "lang_code": "es-419",1171 "resource_type": "ulb",1172 "resource_code": "col",1173 },1174 {1175 "lang_code": "es-419",1176 "resource_type": "tn",1177 "resource_code": "col",1178 },1179 {1180 "lang_code": "es-419",1181 "resource_type": "tq",1182 "resource_code": "col",1183 },1184 {1185 "lang_code": "es-419",1186 "resource_type": "tw",1187 "resource_code": "col",1188 },1189 ],1190 },1191 )1192 finished_document_path = "en-ulb-wa-col_en-tn-wa-col_en-tq-wa-col_en-tw-wa-col_es-419-ulb-col_es-419-tn-col_es-419-tq-col_es-419-tw-col_language_book_order.pdf"...
export_configuration.py
Source:export_configuration.py
...196 :rtype: unicode197 """198 return self._properties['webhook_method']199 @property200 def resource_type(self):201 """202 :returns: The resource_type203 :rtype: unicode204 """205 return self._properties['resource_type']206 @property207 def url(self):208 """209 :returns: The url210 :rtype: unicode211 """212 return self._properties['url']213 def fetch(self):214 """...
ec2.pyi
Source:ec2.pyi
1"""2This type stub file was generated by pyright.3"""4from . import AWSHelperFn, AWSObject, AWSProperty5VALID_ELASTICINFERENCEACCELERATOR_TYPES = ("eia1.medium", "eia1.large", "eia1.xlarge")6VALID_CLIENTVPNENDPOINT_VPNPORT = (443, 1194)7def validate_elasticinferenceaccelerator_type(elasticinferenceaccelerator_type):8 """Validate ElasticInferenceAccelerator for Instance"""9 ...10def validate_clientvpnendpoint_vpnport(vpnport):11 """Validate VpnPort for ClientVpnEndpoint"""12 ...13class Tag(AWSProperty):14 props = ...15 def __init__(self, key=..., value=..., **kwargs) -> None: ...16class CarrierGateway(AWSObject):17 resource_type = ...18 props = ...19class CustomerGateway(AWSObject):20 resource_type = ...21 props = ...22class DHCPOptions(AWSObject):23 resource_type = ...24 props = ...25class EgressOnlyInternetGateway(AWSObject):26 resource_type = ...27 props = ...28class EIP(AWSObject):29 resource_type = ...30 props = ...31class EIPAssociation(AWSObject):32 resource_type = ...33 props = ...34class FlowLog(AWSObject):35 resource_type = ...36 props = ...37class NatGateway(AWSObject):38 resource_type = ...39 props = ...40class EBSBlockDevice(AWSProperty):41 props = ...42NO_DEVICE = {}43class BlockDeviceMapping(AWSProperty):44 props = ...45class LaunchTemplateBlockDeviceMapping(AWSProperty):46 props = ...47class MountPoint(AWSProperty):48 props = ...49class Placement(AWSProperty):50 props = ...51class CpuOptions(AWSProperty):52 props = ...53class CreditSpecification(AWSProperty):54 props = ...55class ElasticGpuSpecification(AWSProperty):56 props = ...57class Ipv6Addresses(AWSHelperFn):58 def __init__(self, address) -> None: ...59class LaunchTemplateSpecification(AWSProperty):60 props = ...61class PrivateIpAddressSpecification(AWSProperty):62 props = ...63class NetworkInterfaceProperty(AWSProperty):64 props = ...65class AssociationParameters(AWSProperty):66 props = ...67class SsmAssociations(AWSProperty):68 props = ...69class GatewayRouteTableAssociation(AWSObject):70 resource_type = ...71 props = ...72class Host(AWSObject):73 resource_type = ...74 props = ...75class ElasticInferenceAccelerator(AWSProperty):76 props = ...77class LicenseSpecification(AWSProperty):78 props = ...79class HibernationOptions(AWSProperty):80 props = ...81class Instance(AWSObject):82 resource_type = ...83 props = ...84class InternetGateway(AWSObject):85 resource_type = ...86 props = ...87class NetworkAcl(AWSObject):88 resource_type = ...89 props = ...90class ICMP(AWSProperty):91 props = ...92class PortRange(AWSProperty):93 props = ...94class NetworkAclEntry(AWSObject):95 resource_type = ...96 props = ...97 def validate(self): ...98class NetworkInterface(AWSObject):99 resource_type = ...100 props = ...101class NetworkInterfaceAttachment(AWSObject):102 resource_type = ...103 props = ...104PERMISSION_INSTANCE_ATTACH = "INSTANCE-ATTACH"105PERMISSION_EIP_ASSOCIATE = "EIP-ASSOCIATE"106class NetworkInterfacePermission(AWSObject):107 resource_type = ...108 props = ...109class Entry(AWSProperty):110 props = ...111class PrefixList(AWSObject):112 resource_type = ...113 props = ...114class Route(AWSObject):115 resource_type = ...116 props = ...117 def validate(self): ...118class RouteTable(AWSObject):119 resource_type = ...120 props = ...121def check_ports(props): ...122class SecurityGroupEgress(AWSObject):123 resource_type = ...124 props = ...125 def validate(self): ...126class SecurityGroupIngress(AWSObject):127 resource_type = ...128 props = ...129 def validate(self): ...130class SecurityGroupRule(AWSProperty):131 props = ...132class SecurityGroup(AWSObject):133 resource_type = ...134 props = ...135class Subnet(AWSObject):136 resource_type = ...137 props = ...138 def validate(self): ...139class SubnetNetworkAclAssociation(AWSObject):140 resource_type = ...141 props = ...142class SubnetRouteTableAssociation(AWSObject):143 resource_type = ...144 props = ...145class Volume(AWSObject):146 resource_type = ...147 props = ...148class VolumeAttachment(AWSObject):149 resource_type = ...150 props = ...151def instance_tenancy(value): ...152class VPC(AWSObject):153 resource_type = ...154 props = ...155class VPCDHCPOptionsAssociation(AWSObject):156 resource_type = ...157 props = ...158class VPCEndpoint(AWSObject):159 resource_type = ...160 props = ...161class VPCEndpointConnectionNotification(AWSObject):162 resource_type = ...163 props = ...164class VPCEndpointService(AWSObject):165 resource_type = ...166 props = ...167class VPCEndpointServicePermissions(AWSObject):168 resource_type = ...169 props = ...170class VPCGatewayAttachment(AWSObject):171 resource_type = ...172 props = ...173class VpnTunnelOptionsSpecification(AWSProperty):174 props = ...175class VPNConnection(AWSObject):176 resource_type = ...177 props = ...178 def validate(self): ...179class VPNConnectionRoute(AWSObject):180 resource_type = ...181 props = ...182class VPNGateway(AWSObject):183 resource_type = ...184 props = ...185class VPNGatewayRoutePropagation(AWSObject):186 resource_type = ...187 props = ...188class VPCPeeringConnection(AWSObject):189 resource_type = ...190 props = ...191class Monitoring(AWSProperty):192 props = ...193class NetworkInterfaces(AWSProperty):194 props = ...195class SecurityGroups(AWSProperty):196 props = ...197class IamInstanceProfile(AWSProperty):198 props = ...199class SpotFleetTagSpecification(AWSProperty):200 props = ...201class LaunchSpecifications(AWSProperty):202 props = ...203class LaunchTemplateOverrides(AWSProperty):204 props = ...205class LaunchTemplateConfigs(AWSProperty):206 props = ...207class ClassicLoadBalancer(AWSProperty):208 props = ...209class ClassicLoadBalancersConfig(AWSProperty):210 props = ...211class TargetGroup(AWSProperty):212 props = ...213class TargetGroupConfig(AWSProperty):214 props = ...215class LoadBalancersConfig(AWSProperty):216 props = ...217class SpotFleetRequestConfigData(AWSProperty):218 props = ...219 def validate(self): ...220class SpotFleet(AWSObject):221 resource_type = ...222 props = ...223class PlacementGroup(AWSObject):224 resource_type = ...225 props = ...226class SubnetCidrBlock(AWSObject):227 resource_type = ...228 props = ...229class VPCCidrBlock(AWSObject):230 resource_type = ...231 props = ...232class TagSpecifications(AWSProperty):233 props = ...234class SpotOptions(AWSProperty):235 props = ...236class InstanceMarketOptions(AWSProperty):237 props = ...238class LaunchTemplateCreditSpecification(AWSProperty):239 props = ...240class MetadataOptions(AWSProperty):241 props = ...242class LaunchTemplateElasticInferenceAccelerator(AWSProperty):243 props = ...244class LaunchTemplateData(AWSProperty):245 props = ...246class LaunchTemplate(AWSObject):247 resource_type = ...248 props = ...249class TrafficMirrorFilter(AWSObject):250 resource_type = ...251 props = ...252class TrafficMirrorPortRange(AWSProperty):253 props = ...254class TrafficMirrorFilterRule(AWSObject):255 resource_type = ...256 props = ...257class TrafficMirrorSession(AWSObject):258 resource_type = ...259 props = ...260class TrafficMirrorTarget(AWSObject):261 resource_type = ...262 props = ...263class TransitGateway(AWSObject):264 resource_type = ...265 props = ...266class TransitGatewayAttachment(AWSObject):267 resource_type = ...268 props = ...269class TransitGatewayRoute(AWSObject):270 resource_type = ...271 props = ...272class TransitGatewayRouteTable(AWSObject):273 resource_type = ...274 props = ...275class TransitGatewayRouteTableAssociation(AWSObject):276 resource_type = ...277 props = ...278class TransitGatewayRouteTablePropagation(AWSObject):279 resource_type = ...280 props = ...281class FleetLaunchTemplateSpecificationRequest(AWSProperty):282 props = ...283class FleetLaunchTemplateOverridesRequest(AWSProperty):284 props = ...285class FleetLaunchTemplateConfigRequest(AWSProperty):286 props = ...287class OnDemandOptionsRequest(AWSProperty):288 props = ...289class SpotOptionsRequest(AWSProperty):290 props = ...291class TargetCapacitySpecificationRequest(AWSProperty):292 props = ...293class EC2Fleet(AWSObject):294 resource_type = ...295 props = ...296class CapacityReservation(AWSObject):297 resource_type = ...298 props = ...299class ClientVpnAuthorizationRule(AWSObject):300 resource_type = ...301 props = ...302class CertificateAuthenticationRequest(AWSProperty):303 props = ...304class DirectoryServiceAuthenticationRequest(AWSProperty):305 props = ...306class FederatedAuthenticationRequest(AWSProperty):307 props = ...308class ClientAuthenticationRequest(AWSProperty):309 props = ...310class ConnectionLogOptions(AWSProperty):311 props = ...312class ClientVpnEndpoint(AWSObject):313 resource_type = ...314 props = ...315class ClientVpnRoute(AWSObject):316 resource_type = ...317 props = ...318class ClientVpnTargetNetworkAssociation(AWSObject):319 resource_type = ...320 props = ...321class LocalGatewayRoute(AWSObject):322 resource_type = ...323 props = ...324class LocalGatewayRouteTableVPCAssociation(AWSObject):325 resource_type = ......
LambdaTest’s Playwright tutorial will give you a broader idea about the Playwright automation framework, its unique features, and use cases with examples to exceed your understanding of Playwright testing. This tutorial will give A to Z guidance, from installing the Playwright framework to some best practices and advanced concepts.
Get 100 minutes of automation test minutes FREE!!