Skip to content

Commit 96f4d08

Browse files
committed
Pin synthetic publisher fixture integrity assertions before send and handoff race
1 parent 47650f4 commit 96f4d08

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎tests/test_publication_manual_handoff.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@ def test_stale_automatic_selection_does_not_send_after_owner_handoff(self):
181181
with common.connect() as db:
182182
self.existing(db)
183183
common.set_setting(db,"auto_enabled","1")
184+
with common.connect() as db:
185+
self.assertIsNotNone(worker.load_record(RID))
186+
self.assertEqual(db.execute("SELECT approval_sha256,post_id,draft_comment "
187+
"FROM publish_jobs WHERE run_id=?",(RID,)).fetchone(),
188+
(self.record["approval_sha256"],PID,self.record["draft_comment"]))
184189
emitted=[]
185190
def get_then_approve(method,path,*args,**kwargs):
186191
emitted.append(method)
@@ -209,6 +214,11 @@ def test_existing_manual_publisher_path_claims_one_send(self):
209214
with common.connect() as db:
210215
self.approve(db)
211216
common.queue_manual(db,RID)
217+
with common.connect() as db:
218+
self.assertIsNotNone(worker.load_record(RID))
219+
self.assertEqual(db.execute("SELECT approval_sha256,post_id,draft_comment "
220+
"FROM publish_jobs WHERE run_id=?",(RID,)).fetchone(),
221+
(self.record["approval_sha256"],PID,self.record["draft_comment"]))
212222
requests=[]
213223
def stub(method,path,*args,**kwargs):
214224
requests.append(method)

0 commit comments

Comments
 (0)