@@ -535,8 +535,11 @@ def test_successful_build(
535
535
"builder" : mock .ANY ,
536
536
}
537
537
538
+ # NOTE: `request_history[5]` is a temporal notification that will be removed after October 7th
539
+ # https://github.com/readthedocs/readthedocs.org/pull/11514
540
+
538
541
# Update build state: installing
539
- assert self .requests_mock .request_history [5 ].json () == {
542
+ assert self .requests_mock .request_history [6 ].json () == {
540
543
"id" : 1 ,
541
544
"state" : "installing" ,
542
545
"commit" : "a1b2c3" ,
@@ -599,7 +602,7 @@ def test_successful_build(
599
602
},
600
603
}
601
604
# Update build state: building
602
- assert self .requests_mock .request_history [6 ].json () == {
605
+ assert self .requests_mock .request_history [7 ].json () == {
603
606
"id" : 1 ,
604
607
"state" : "building" ,
605
608
"commit" : "a1b2c3" ,
@@ -609,7 +612,7 @@ def test_successful_build(
609
612
"error" : "" ,
610
613
}
611
614
# Update build state: uploading
612
- assert self .requests_mock .request_history [7 ].json () == {
615
+ assert self .requests_mock .request_history [8 ].json () == {
613
616
"id" : 1 ,
614
617
"state" : "uploading" ,
615
618
"commit" : "a1b2c3" ,
@@ -619,9 +622,9 @@ def test_successful_build(
619
622
"error" : "" ,
620
623
}
621
624
# Update version state
622
- assert self .requests_mock .request_history [8 ]._request .method == "PATCH"
623
- assert self .requests_mock .request_history [8 ].path == "/api/v2/version/1/"
624
- assert self .requests_mock .request_history [8 ].json () == {
625
+ assert self .requests_mock .request_history [9 ]._request .method == "PATCH"
626
+ assert self .requests_mock .request_history [9 ].path == "/api/v2/version/1/"
627
+ assert self .requests_mock .request_history [9 ].json () == {
625
628
"addons" : False ,
626
629
"build_data" : None ,
627
630
"built" : True ,
@@ -631,11 +634,13 @@ def test_successful_build(
631
634
"has_htmlzip" : True ,
632
635
}
633
636
# Set project has valid clone
634
- assert self .requests_mock .request_history [9 ]._request .method == "PATCH"
635
- assert self .requests_mock .request_history [9 ].path == "/api/v2/project/1/"
636
- assert self .requests_mock .request_history [9 ].json () == {"has_valid_clone" : True }
637
- # Update build state: finished, success and builder
637
+ assert self .requests_mock .request_history [10 ]._request .method == "PATCH"
638
+ assert self .requests_mock .request_history [10 ].path == "/api/v2/project/1/"
638
639
assert self .requests_mock .request_history [10 ].json () == {
640
+ "has_valid_clone" : True
641
+ }
642
+ # Update build state: finished, success and builder
643
+ assert self .requests_mock .request_history [11 ].json () == {
639
644
"id" : 1 ,
640
645
"state" : "finished" ,
641
646
"commit" : "a1b2c3" ,
@@ -647,8 +652,8 @@ def test_successful_build(
647
652
"error" : "" ,
648
653
}
649
654
650
- assert self .requests_mock .request_history [11 ]._request .method == "POST"
651
- assert self .requests_mock .request_history [11 ].path == "/api/v2/revoke/"
655
+ assert self .requests_mock .request_history [12 ]._request .method == "POST"
656
+ assert self .requests_mock .request_history [12 ].path == "/api/v2/revoke/"
652
657
653
658
assert BuildData .objects .all ().exists ()
654
659
0 commit comments