mirror of
https://codeberg.org/demostf/api-test.git
synced 2026-06-03 17:44:07 +02:00
inline data
This commit is contained in:
parent
6ea01ad0c8
commit
cec7626cf2
1 changed files with 4 additions and 4 deletions
|
|
@ -21,14 +21,14 @@ macro_rules! assert_object_eq {
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> Result<()> {
|
async fn main() -> Result<()> {
|
||||||
let harness = Harness::new(&dotenv::var("BASE_URL")?, &dotenv::var("DB_URL")?).await?;
|
let harness = Harness::new(&dotenv::var("BASE_URL")?, &dotenv::var("DB_URL")?).await?;
|
||||||
|
let gully_data = include_bytes!("../data/gully.dem");
|
||||||
|
|
||||||
Test::run(
|
Test::run(
|
||||||
"Upload demo, then retrieve info",
|
"Upload demo, then retrieve info",
|
||||||
&harness,
|
&harness,
|
||||||
|test| async move {
|
|test| async move {
|
||||||
let data = std::fs::read("data/gully.dem")?;
|
let parser =
|
||||||
let upload_data = data.clone();
|
DemoParser::new(BitReadBuffer::new(gully_data.to_vec(), LittleEndian).into());
|
||||||
let parser = DemoParser::new(BitReadBuffer::new(data, LittleEndian).into());
|
|
||||||
let (header, state) = parser
|
let (header, state) = parser
|
||||||
.parse()
|
.parse()
|
||||||
.map_err(|_| Report::msg("Failed to parse demo"))?;
|
.map_err(|_| Report::msg("Failed to parse demo"))?;
|
||||||
|
|
@ -39,7 +39,7 @@ async fn main() -> Result<()> {
|
||||||
Ok(client
|
Ok(client
|
||||||
.upload_demo(
|
.upload_demo(
|
||||||
String::from("test.dem"),
|
String::from("test.dem"),
|
||||||
upload_data,
|
gully_data.to_vec(),
|
||||||
String::from("RED"),
|
String::from("RED"),
|
||||||
String::from("BLUE"),
|
String::from("BLUE"),
|
||||||
String::from("token"),
|
String::from("token"),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue