更新
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Read-only post-release verification for nearby post media."""
|
||||
import json
|
||||
import sys
|
||||
|
||||
sys.path.insert(0, '/www/server/xingyu-im/ops')
|
||||
from baota_publish_test_users import BT, database, digest, env_values, health, query
|
||||
|
||||
EXPECTED = 'e8e071ec7006a32303f7cd654cddad8afda22ecb4fe83464305a9d3aef4d7280'
|
||||
health()
|
||||
assert digest(BT / 'xingyu-api') == EXPECTED
|
||||
connection, _ = database(env_values())
|
||||
try:
|
||||
row = query(connection, "SELECT post.id,COUNT(media.id) FROM posts post JOIN users user ON user.id=post.user_id LEFT JOIN post_media media ON media.post_id=post.id WHERE user.public_id=%s AND post.status=1 AND post.deleted_at IS NULL GROUP BY post.id ORDER BY post.created_at DESC LIMIT 1", ('TESTCN000100',))[0]
|
||||
assert row == (1, 2)
|
||||
print(json.dumps({'health': 'ok', 'backendSha256': EXPECTED, 'postId': row[0], 'mediaCount': row[1]}))
|
||||
finally:
|
||||
connection.close()
|
||||
Reference in New Issue
Block a user