fix: respect rejected batch import receipts
This commit is contained in:
1 parent
eda9403d94
commit
de16bbdfa1
3 files changed
+18
-1
No files matched your search
@@ -94,3 +94,12 @@ def test_cancelled_request_cannot_be_reused_for_different_input(service, tmp_pat
|
||||
with pytest.raises(TaskCenterError) as error:
|
||||
service.import_pairs(task, (), request_id='batch', stop_event=Event())
|
||||
assert error.value.code == 'verification_conflict'
|
||||
|
||||
|
||||
def test_rejected_display_name_is_not_reported_as_imported(service, tmp_path):
|
||||
pairs = ((project(tmp_path/'before', 'A'), project(tmp_path/'after', 'A')),)
|
||||
task = service.create_task('拒绝', request_id='create')['task_id']
|
||||
result = service.import_pairs(task, pairs, request_id='batch', stop_event=Event(), display_names=('x'*257,))
|
||||
assert result['rows'][0]['status'] == 'failed'
|
||||
assert result['rows'][0]['reason']
|
||||
assert service.repo.connection.execute('SELECT COUNT(*) FROM verification_items').fetchone()[0] == 0
|
||||
Reference in new issue
Block a user