1
0
Fork 0
mirror of https://codeberg.org/tyy/aspm synced 2024-12-22 15:59:29 -07:00

Update dependencies, start on e2e cli tests

This commit is contained in:
Tyler Beckman 2024-07-08 15:40:07 -04:00
parent cf6bbfeecf
commit 47b1753390
Signed by: Ty
GPG key ID: 2813440C772555A4
7 changed files with 1168 additions and 600 deletions

1668
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -12,28 +12,33 @@ edition = "2021"
members = ["crates/*"]
[dependencies]
anyhow = "1.0.79"
anyhow = "1.0.86"
app_dirs2 = "2.5.5"
clap = { version = "4.4.18", features = ["derive", "unstable-styles", "env"] }
thiserror = "1.0.56"
clap = { version = "4.5.8", features = ["derive", "unstable-styles", "env"] }
thiserror = "1.0.61"
asp = { path = "crates/asp" }
indoc = "2.0.4"
anstyle = "1.0.4"
indoc = "2.0.5"
anstyle = "1.0.7"
dialoguer = { version = "0.11.0", features = ["password"] }
argon2 = { version = "0.5.3", features = ["std"] }
data-encoding = "2.5.0"
sea-orm = { version = "0.12.12", features = ["sqlx-sqlite", "runtime-tokio-rustls"] }
async-trait = "0.1.77"
tokio = "1.35.1"
clap-stdin = "0.4.0"
data-encoding = "2.6.0"
sea-orm = { version = "0.12.15", features = ["sqlx-sqlite", "runtime-tokio-rustls"] }
async-trait = "0.1.81"
tokio = "1.38.0"
clap-stdin = "0.5.0"
gpgme = { version = "0.11.0", optional = true }
sequoia-openpgp = { version = "1.18.0", optional = true }
josekit = { version = "0.8.5" }
sequoia-openpgp = { version = "1.21.1", optional = true }
josekit = { version = "0.8.6" }
aes-gcm = "0.10.3"
migrations = { path = "crates/migrations" }
scrypt = "0.11.0"
serde = { version = "1.0.197", features = ["derive"] }
serde_json = "1.0.114"
serde = { version = "1.0.204", features = ["derive"] }
serde_json = "1.0.120"
[dev-dependencies]
assert_cmd = "2.0.14"
predicates = "3.1.0"
tempfile = "3.10.1"
[features]
gpg-compat = ["dep:gpgme", "dep:sequoia-openpgp"]

View file

@ -7,16 +7,16 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
anyhow = "1.0.71"
data-encoding = "2.4.0"
hex_color = { version = "2.0.0", features = ["serde"] }
josekit = "0.8.3"
openssl = "0.10.55"
reqwest = "0.11.18"
serde = { version = "1.0.164", features = ["derive"] }
serde-email = "2.0.0"
serde_json = { version = "1.0.99", features = ["preserve_order"] }
sha2 = "0.10.7"
thiserror = "1.0.40"
tokio = { version = "1.28.2", features = ["macros", "rt-multi-thread"] }
url = { version = "2.4.0", features = ["serde"] }
anyhow = "1.0.86"
data-encoding = "2.6.0"
hex_color = { version = "3.0.0", features = ["serde"] }
josekit = "0.8.6"
openssl = "0.10.64"
reqwest = "0.12.5"
serde = { version = "1.0.204", features = ["derive"] }
serde-email = "3.0.1"
serde_json = { version = "1.0.120", features = ["preserve_order"] }
sha2 = "0.10.8"
thiserror = "1.0.61"
tokio = { version = "1.38.0", features = ["macros", "rt-multi-thread"] }
url = { version = "2.5.2", features = ["serde"] }

View file

@ -6,5 +6,5 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
sea-orm-migration = { version = "0.12.14", features = ["sqlx-sqlite", "runtime-tokio-rustls"] }
tokio = { version = "1.36.0", features = ["rt-multi-thread", "macros"] }
sea-orm-migration = { version = "0.12.15", features = ["sqlx-sqlite", "runtime-tokio-rustls"] }
tokio = { version = "1.38.0", features = ["rt-multi-thread", "macros"] }

View file

@ -130,7 +130,7 @@ impl AspmSubcommand for ProfilesCreateCommand {
avatar_url: ActiveValue::Set(
profile.avatar_url.map(|avatar_url| avatar_url.to_string()),
),
color: ActiveValue::Set(profile.color.map(|color| color.to_string())),
color: ActiveValue::Set(profile.color.map(|color| color.display_rgb().to_string())),
key: ActiveValue::Set(keys[key_index].fingerprint.clone()),
})
.exec(&state.db)

View file

@ -76,7 +76,7 @@ impl AspmSubcommand for ProfilesImportCommand {
.into_active_value(),
color: profile
.color
.map(|color| color.to_string())
.map(|color| color.display_rgb().to_string())
.into_active_value(),
})
.exec(&txn)

33
tests/cli.rs Normal file
View file

@ -0,0 +1,33 @@
use anyhow::Context;
use assert_cmd::prelude::*;
use predicates::prelude::*;
use tempfile::TempDir;
use std::process::Command;
#[test]
fn help_prints_correctly() -> Result<(), anyhow::Error> {
let tempdir = TempDir::new()?;
let datadir = tempdir.path().to_str().context("Tempdir path was not valid utf8")?;
Command::cargo_bin("aspm")?
.env("ASPM_DATA_DIR", datadir)
.arg("--help")
.assert()
.success()
.stdout(predicate::str::starts_with(env!("CARGO_PKG_DESCRIPTION")));
Command::cargo_bin("aspm")?
.env("ASPM_DATA_DIR", datadir)
.arg("-h")
.assert()
.success()
.stdout(predicate::str::starts_with(env!("CARGO_PKG_DESCRIPTION")));
Command::cargo_bin("aspm")?
.env("ASPM_DATA_DIR", datadir)
.assert()
.code(2)
.stderr(predicate::str::starts_with(env!("CARGO_PKG_DESCRIPTION")));
Ok(())
}