summaryrefslogtreecommitdiff
path: root/qa/stub
diff options
context:
space:
mode:
Diffstat (limited to 'qa/stub')
-rwxr-xr-xqa/stub/fund-lab-python11
1 files changed, 11 insertions, 0 deletions
diff --git a/qa/stub/fund-lab-python b/qa/stub/fund-lab-python
index 9a171bc..5c6daa3 100755
--- a/qa/stub/fund-lab-python
+++ b/qa/stub/fund-lab-python
@@ -42,6 +42,17 @@ case "$OP" in
exit 2
fi
;;
+ stock-quote)
+ # Synthetic rows mirror the live AKShare A-share spot contract: a known live
+ # code answers with a name/price, unknown codes fail like the "no valid
+ # quote" collector error (-> API 503).
+ if [ "$CODE" = "600519" ]; then
+ printf '{"schema_version":"fund-lab.akshare.v1","operation":"stock-quote","source":"stub-synthetic","source_revision":"stub-1","_synthetic":true,"collected_at":"%s","instrument":{"code":"%s"},"quote":{"name":"贵州茅台","price":"1252.57","currency":"CNY"}}\n' "$TS" "$CODE"
+ else
+ echo "AKShare collector failed: no valid quote for $CODE" >&2
+ exit 2
+ fi
+ ;;
*)
echo "unknown operation: $OP" >&2
exit 2