def test_record_add_document(min_score, connection, project, document):
"""Verifies adding document records to a project."""
httpretty.register_uri(
httpretty.POST, '{}/records/upload/document/{}'.format(
matchlight.MATCHLIGHT_API_URL_V2, project.upload_token),
body=json.dumps({
'id': uuid.uuid4().hex,
'name': 'name',
'description': '',
'ctime': time.time(),
'mtime': time.time(),
'metadata': '{}',
}),
content_type='application/json', status=200)
connection.records.add_document(
project=project,
name=document['name'],
description=document['description'],
document_path=DOCUMENT_RECORD_PATH,
min_score=min_score)
评论列表
文章目录