chore: upgrade kxio to v5.0
Update tests to use net.assert_no_unused_plans()
This commit is contained in:
parent
4ec603ca3a
commit
5bad451c7b
18 changed files with 63 additions and 85 deletions
|
@ -16,10 +16,10 @@ derive_more = { version = "1.0", features = [
|
|||
] }
|
||||
inquire = "0.7"
|
||||
kameo = "0.13"
|
||||
# kxio = {path = "../kxio/"}
|
||||
kxio = "4.0"
|
||||
# kxio = { path = "../kxio/" }
|
||||
kxio = "5.0"
|
||||
rand = "0.8"
|
||||
reqwest = { version = "0.12" , features = ["multipart", "stream"]}
|
||||
reqwest = { version = "0.12", features = ["multipart", "stream"] }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
tokio = { version = "1.41", features = ["full", "tracing"] }
|
||||
|
|
|
@ -70,6 +70,8 @@ async fn dump(ctx: FullCtx, board_id: NextcloudBoardId) {
|
|||
output.trim(),
|
||||
include_str!("../../../tests/responses/nextcloud-board-create-label.json").trim()
|
||||
);
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
}
|
||||
|
||||
#[rstest::rstest]
|
||||
|
@ -95,4 +97,6 @@ async fn no_dump(ctx: FullCtx, board_id: NextcloudBoardId) {
|
|||
//then
|
||||
let output = prt.output();
|
||||
assert_peq!(output.trim(), "2:54:my green label:31CC7C");
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
}
|
||||
|
|
|
@ -1,82 +0,0 @@
|
|||
use crate::execute::Execute;
|
||||
use crate::nextcloud::board::NextcloudBoardCommand;
|
||||
use crate::nextcloud::card::NextcloudCardCommand;
|
||||
use crate::nextcloud::stack::NextcloudStackCommand;
|
||||
use crate::nextcloud::NextcloudCommand;
|
||||
use crate::Command;
|
||||
//
|
||||
use super::*;
|
||||
|
||||
#[rstest::fixture]
|
||||
fn board_id() -> NextcloudBoardId {
|
||||
NextcloudBoardId::new(1)
|
||||
}
|
||||
|
||||
#[rstest::fixture]
|
||||
fn ctx() -> FullCtx {
|
||||
let fs = given::a_filesystem();
|
||||
|
||||
let nextcloud_config = given::a_nextcloud_config();
|
||||
|
||||
let hostname = &nextcloud_config.hostname;
|
||||
let board_id = board_id();
|
||||
|
||||
let mock_net = given::a_network();
|
||||
mock_net
|
||||
.on()
|
||||
.get(crate::f!(
|
||||
"{hostname}/index.php/apps/deck/api/v1.0/boards/{board_id}/stacks",
|
||||
))
|
||||
.respond(StatusCode::OK)
|
||||
.body(include_str!(
|
||||
"../../../tests/responses/nextcloud-board-get.json"
|
||||
))
|
||||
.expect("mock request");
|
||||
|
||||
given::a_full_context(fs, mock_net)
|
||||
}
|
||||
|
||||
#[rstest::rstest]
|
||||
#[test_log::test(tokio::test)]
|
||||
async fn dump(ctx: FullCtx, board_id: NextcloudBoardId) {
|
||||
//given
|
||||
let prt = ctx.prt.clone();
|
||||
let prt = prt.as_test().unwrap();
|
||||
|
||||
//when
|
||||
Command::Nextcloud(NextcloudCommand::Board(NextcloudBoardCommand::Get {
|
||||
dump: true,
|
||||
board_id: board_id.into(),
|
||||
}))
|
||||
.execute(&ctx)
|
||||
.await
|
||||
.expect("execute");
|
||||
|
||||
//then
|
||||
let output = prt.output();
|
||||
assert_eq!(
|
||||
output.trim(),
|
||||
include_str!("../../../tests/responses/nextcloud-board-get.json").trim()
|
||||
);
|
||||
}
|
||||
|
||||
#[rstest::rstest]
|
||||
#[test_log::test(tokio::test)]
|
||||
async fn no_dump(ctx: FullCtx, board_id: NextcloudBoardId) {
|
||||
//given
|
||||
let prt = ctx.prt.clone();
|
||||
let prt = prt.as_test().unwrap();
|
||||
|
||||
//when
|
||||
Command::Nextcloud(NextcloudCommand::Board(NextcloudBoardCommand::Get {
|
||||
dump: false,
|
||||
board_id: board_id.into(),
|
||||
}))
|
||||
.execute(&ctx)
|
||||
.await
|
||||
.expect("execute");
|
||||
|
||||
//then
|
||||
let output = prt.output();
|
||||
assert_eq!(output.trim(), ["2:Doing\n3:Done\n1:To do"].join("\n"));
|
||||
}
|
|
@ -52,6 +52,8 @@ async fn dump(ctx: FullCtx, board_id: NextcloudBoardId) {
|
|||
output.trim(),
|
||||
include_str!("../../../tests/responses/nextcloud-board-labels.json").trim()
|
||||
);
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
}
|
||||
|
||||
#[rstest::rstest]
|
||||
|
@ -82,4 +84,6 @@ async fn no_dump(ctx: FullCtx, board_id: NextcloudBoardId) {
|
|||
]
|
||||
.join("\n")
|
||||
);
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
}
|
||||
|
|
|
@ -100,6 +100,8 @@ async fn dump(
|
|||
output.trim(),
|
||||
include_str!("../../../tests/responses/nextcloud-attachment-add.json")
|
||||
);
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
}
|
||||
|
||||
#[rstest::rstest]
|
||||
|
@ -132,4 +134,6 @@ async fn no_dump(
|
|||
//then
|
||||
let output = prt.output();
|
||||
assert_eq!(output.trim(), "2:1:1:102");
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
}
|
||||
|
|
|
@ -80,6 +80,8 @@ async fn dump(
|
|||
//then
|
||||
let output = prt.output();
|
||||
assert_peq!(output.trim(), "null");
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
}
|
||||
|
||||
#[rstest::rstest]
|
||||
|
@ -110,4 +112,6 @@ async fn no_dump(
|
|||
//then
|
||||
let output = prt.output();
|
||||
assert_eq!(output, "");
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
}
|
||||
|
|
|
@ -75,6 +75,8 @@ async fn dump(
|
|||
output.trim(),
|
||||
include_str!("../../../tests/responses/nextcloud-card-create.json").trim()
|
||||
);
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
}
|
||||
|
||||
#[rstest::rstest]
|
||||
|
@ -106,4 +108,6 @@ async fn no_dump(
|
|||
//then
|
||||
let output = prt.output();
|
||||
assert_peq!(output.trim(), "2:1:331:my new card");
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
}
|
||||
|
|
|
@ -77,6 +77,8 @@ async fn dump(
|
|||
output.trim(),
|
||||
include_str!("../../../tests/responses/nextcloud-card-get.json").trim()
|
||||
);
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
}
|
||||
|
||||
#[rstest::rstest]
|
||||
|
@ -105,4 +107,6 @@ async fn no_dump(
|
|||
//then
|
||||
let output = prt.output();
|
||||
assert_peq!(output.trim(), "2:1:321:Breakfast: Cereal");
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
}
|
||||
|
|
|
@ -52,6 +52,8 @@ async fn dump(ctx: FullCtx) {
|
|||
output.trim(),
|
||||
include_str!("../../../tests/responses/nextcloud-deck-get.json").trim()
|
||||
);
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
}
|
||||
|
||||
#[rstest::rstest]
|
||||
|
@ -80,4 +82,6 @@ async fn no_dump(ctx: FullCtx) {
|
|||
]
|
||||
.join("\n")
|
||||
);
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
}
|
||||
|
|
|
@ -63,6 +63,8 @@ async fn dump(ctx: FullCtx, board_id: NextcloudBoardId, stack_title: NextcloudSt
|
|||
output.trim(),
|
||||
include_str!("../../../tests/responses/nextcloud-stack-create.json").trim()
|
||||
);
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
}
|
||||
|
||||
#[rstest::rstest]
|
||||
|
@ -85,4 +87,6 @@ async fn no_dump(ctx: FullCtx, board_id: NextcloudBoardId, stack_title: Nextclou
|
|||
//then
|
||||
let output = prt.output();
|
||||
assert_peq!(output.trim(), ["1:30:Lunch"].join("\n"));
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
}
|
||||
|
|
|
@ -63,6 +63,8 @@ async fn dump(ctx: FullCtx, board_id: NextcloudBoardId, stack_id: NextcloudStack
|
|||
output.trim(),
|
||||
include_str!("../../../tests/responses/nextcloud-stack-get.json").trim()
|
||||
);
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
}
|
||||
|
||||
#[rstest::rstest]
|
||||
|
@ -85,4 +87,6 @@ async fn no_dump(ctx: FullCtx, board_id: NextcloudBoardId, stack_id: NextcloudSt
|
|||
//then
|
||||
let output = prt.output();
|
||||
assert_peq!(output.trim(), ["322:Lunch: Soup & Toast"].join("\n"));
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
}
|
||||
|
|
|
@ -164,5 +164,7 @@ async fn test_run() -> Result<()> {
|
|||
.join("\n")
|
||||
);
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
@ -83,6 +83,8 @@ async fn dump(ctx: FullCtx, card_id: TrelloCardId, attachment_id: TrelloAttachme
|
|||
output.trim(),
|
||||
include_str!("../../../tests/responses/trello-attachment-get.json").trim()
|
||||
);
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
}
|
||||
|
||||
#[rstest::rstest]
|
||||
|
@ -108,4 +110,6 @@ async fn no_dump(ctx: FullCtx, card_id: TrelloCardId, attachment_id: TrelloAttac
|
|||
output.trim(),
|
||||
["Backlog.png:https://trello.com/1/cards/65ad94865aed24f70ecdcebb/attachments/65ad94875aed24f70ecdd037/download/Backlog.png"].join("\n")
|
||||
);
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
}
|
||||
|
|
|
@ -131,4 +131,6 @@ async fn save(
|
|||
data,
|
||||
include_bytes!("../../../tests/responses/trello-attachment-save.png").as_slice()
|
||||
);
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
}
|
||||
|
|
|
@ -67,6 +67,8 @@ async fn dump(ctx: FullCtx, board_id: TrelloBoardId) {
|
|||
output.trim(),
|
||||
include_str!("../../../tests/responses/trello-board-get.json").trim()
|
||||
);
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
}
|
||||
|
||||
#[rstest::rstest]
|
||||
|
@ -96,4 +98,6 @@ async fn no_dump(ctx: FullCtx, board_id: TrelloBoardId) {
|
|||
]
|
||||
.join("\n")
|
||||
);
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
}
|
||||
|
|
|
@ -67,6 +67,8 @@ async fn dump(ctx: FullCtx, card_id: TrelloCardId) {
|
|||
output.trim(),
|
||||
include_str!("../../../tests/responses/trello-card-get.json").trim()
|
||||
);
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
}
|
||||
|
||||
#[rstest::rstest]
|
||||
|
@ -91,4 +93,6 @@ async fn no_dump(ctx: FullCtx, card_id: TrelloCardId) {
|
|||
output.trim(),
|
||||
["65ad94875aed24f70ecdd037:Backlog.png"].join("\n")
|
||||
);
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
}
|
||||
|
|
|
@ -58,6 +58,8 @@ async fn dump(ctx: FullCtx) {
|
|||
output.trim(),
|
||||
include_str!("../../../tests/responses/trello-member-get.json")
|
||||
);
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
}
|
||||
|
||||
#[rstest::rstest]
|
||||
|
@ -89,4 +91,6 @@ async fn no_dump(ctx: FullCtx) {
|
|||
]
|
||||
.join("\n")
|
||||
);
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
}
|
||||
|
|
|
@ -69,6 +69,8 @@ async fn dump(ctx: FullCtx, list_id: TrelloListId) {
|
|||
output.trim(),
|
||||
include_str!("../../../tests/responses/trello-stack-get.json").trim()
|
||||
);
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
}
|
||||
|
||||
#[rstest::rstest]
|
||||
|
@ -99,4 +101,6 @@ async fn no_dump(ctx: FullCtx, list_id: TrelloListId) {
|
|||
]
|
||||
.join("\n")
|
||||
);
|
||||
|
||||
ctx.net.assert_no_unused_plans();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue