mirror of
https://codeberg.org/demostf/api-test.git
synced 2026-06-03 17:44:07 +02:00
clippy fixes
This commit is contained in:
parent
67465fc22a
commit
c4aa610433
2 changed files with 8 additions and 11 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
use demostf_client::ApiClient;
|
|
||||||
use sqlx::{Pool, Postgres};
|
|
||||||
use color_eyre::Result;
|
use color_eyre::Result;
|
||||||
|
use demostf_client::ApiClient;
|
||||||
use sqlx::postgres::PgPoolOptions;
|
use sqlx::postgres::PgPoolOptions;
|
||||||
|
use sqlx::{Pool, Postgres};
|
||||||
|
|
||||||
pub struct Harness {
|
pub struct Harness {
|
||||||
client: ApiClient,
|
client: ApiClient,
|
||||||
|
|
@ -13,14 +13,11 @@ impl Harness {
|
||||||
let client = ApiClient::with_base_url(base_url)?;
|
let client = ApiClient::with_base_url(base_url)?;
|
||||||
let db = PgPoolOptions::new()
|
let db = PgPoolOptions::new()
|
||||||
.max_connections(5)
|
.max_connections(5)
|
||||||
.connect(&db_url)
|
.connect(db_url)
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
Ok(Harness {
|
Ok(Harness { client, db })
|
||||||
client,
|
|
||||||
db,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn reset(&self) -> Result<()> {
|
pub async fn reset(&self) -> Result<()> {
|
||||||
|
|
|
||||||
|
|
@ -310,7 +310,7 @@ async fn main() -> Result<()> {
|
||||||
assert_eq(list.len(), 1)?;
|
assert_eq(list.len(), 1)?;
|
||||||
assert_eq(list[0].id, 4)?;
|
assert_eq(list[0].id, 4)?;
|
||||||
|
|
||||||
let players = list[0].get_players(&client).await?;
|
let players = list[0].get_players(client).await?;
|
||||||
let reconnected_player = players
|
let reconnected_player = players
|
||||||
.iter()
|
.iter()
|
||||||
.find(|player| player.user.steam_id == SteamID::from(76561197998883586))
|
.find(|player| player.user.steam_id == SteamID::from(76561197998883586))
|
||||||
|
|
@ -364,7 +364,7 @@ async fn main() -> Result<()> {
|
||||||
|
|
||||||
test.step("list time filter after", |client| async move {
|
test.step("list time filter after", |client| async move {
|
||||||
let list = client
|
let list = client
|
||||||
.list(ListParams::default().with_after(first_time.clone()), 1)
|
.list(ListParams::default().with_after(first_time), 1)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
assert_eq(list.len(), 2)?;
|
assert_eq(list.len(), 2)?;
|
||||||
|
|
@ -376,7 +376,7 @@ async fn main() -> Result<()> {
|
||||||
|
|
||||||
test.step("list time filter before", |client| async move {
|
test.step("list time filter before", |client| async move {
|
||||||
let list = client
|
let list = client
|
||||||
.list(ListParams::default().with_before(first_time.clone()), 1)
|
.list(ListParams::default().with_before(first_time), 1)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
assert_eq(list.len(), 2)?;
|
assert_eq(list.len(), 2)?;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue