mirror of
https://github.com/0xrsydn/idx-cli.git
synced 2026-08-07 01:33:52 +00:00
feat: support explicit MSN chart history
This commit is contained in:
parent
b480828f39
commit
a2d15d2125
13 changed files with 280 additions and 68 deletions
11
tests/cli.rs
11
tests/cli.rs
|
|
@ -520,8 +520,8 @@ fn msn_technical_auto_falls_back_to_yahoo() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn explicit_msn_history_provider_returns_unsupported() {
|
||||
test_bin("msn-history-explicit-unsupported")
|
||||
fn explicit_msn_history_provider_uses_msn_chart_fixture() {
|
||||
test_bin("msn-history-explicit")
|
||||
.env("IDX_PROVIDER", "msn")
|
||||
.env("IDX_USE_MOCK_PROVIDER", "1")
|
||||
.args([
|
||||
|
|
@ -534,10 +534,9 @@ fn explicit_msn_history_provider_returns_unsupported() {
|
|||
"msn",
|
||||
])
|
||||
.assert()
|
||||
.failure()
|
||||
.stderr(predicate::str::contains(
|
||||
"MSN does not provide price history",
|
||||
));
|
||||
.success()
|
||||
.stdout(predicate::str::contains("History for BBCA.JK"))
|
||||
.stdout(predicate::str::contains("8,000"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
17
tests/fixtures/msn_chart_bbca_3m.json
vendored
Normal file
17
tests/fixtures/msn_chart_bbca_3m.json
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
[
|
||||
{
|
||||
"_p": "bn91jc",
|
||||
"chartType": "3M",
|
||||
"symbol": "BBCA",
|
||||
"series": {
|
||||
"timeStamps": [
|
||||
"2026-01-13T17:00:00Z",
|
||||
"2026-01-14T17:00:00Z",
|
||||
"2026-01-15T17:00:00Z"
|
||||
],
|
||||
"prices": [8000.0, 8075.0, 8025.0],
|
||||
"startTime": "2026-01-13T17:00:00Z",
|
||||
"endTime": "2026-01-15T17:00:00Z"
|
||||
}
|
||||
}
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue