-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
basic test is passing, but pagination is not due to differing use case. for marketstack, pagination is actually part of query parameters, so I will leave them as such. its easy to use as part of the builder anyway.
- Loading branch information
1 parent
758c284
commit a8a9b54
Showing
7 changed files
with
80 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,29 @@ | ||
use marketstack::api::{self, eod, Query}; | ||
use marketstack::{EodData, Marketstack}; | ||
|
||
mod setup; | ||
|
||
#[test] | ||
#[ignore] | ||
fn test_eod() { | ||
let api_key = setup::setup_key(); | ||
let client = Marketstack::new_insecure("api.marketstack.com", api_key).unwrap(); | ||
|
||
let endpoint = eod::Eod::builder().symbol("AAPL").build().unwrap(); | ||
let eod_result: EodData = endpoint.query(&client).unwrap(); | ||
|
||
assert_eq!(eod_result.pagination.limit, 100); | ||
assert_eq!(eod_result.pagination.offset, 0); | ||
} | ||
|
||
#[test] | ||
#[ignore] | ||
fn test_eod_paged() { | ||
let api_key = setup::setup_key(); | ||
let client = Marketstack::new_insecure("api.marketstack.com", api_key).unwrap(); | ||
|
||
let pageable_endpoint = eod::Eod::builder().symbol("AAPL").build().unwrap(); | ||
let first_200: EodData = api::paged(pageable_endpoint, api::Pagination::Limit(200)) | ||
.query(&client) | ||
.unwrap(); | ||
} |