Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Remove redundant account output and assertions

Manav Rathi423d7f862f15
diff --git a/rust/apps/cli-next/src/main.rs b/rust/apps/cli-next/src/main.rs
index 5f6cfc277b..5b58fb8a69 100644
--- a/rust/apps/cli-next/src/main.rs
+++ b/rust/apps/cli-next/src/main.rs
@@ -188,12 +188,8 @@ async fn account_command(command: AccountCommand, options: &Options) -> Result<(
}
AccountCommand::View { name } => {
let state = State::load()?;
- let account = AccountView::new(&state.accounts[state.named(&name)?], state.selected);
- if options.json {
- output::json(&account)
- } else {
- output::account(&account)
- }
+ let index = state.named(&name)?;
+ output_account(state, index, options.json)
}
AccountCommand::Token { selector, app } => {
let state = State::load()?;
diff --git a/rust/apps/cli-next/tests/cli.rs b/rust/apps/cli-next/tests/cli.rs
index 36a9bca4d5..976841aeeb 100644
--- a/rust/apps/cli-next/tests/cli.rs
+++ b/rust/apps/cli-next/tests/cli.rs
@@ -36,14 +36,6 @@ fn reads_do_not_initialize_storage() {
assert!(help.contains(&format!("=== {binary} photos file download ===")));
assert!(help.contains(&format!("=== {binary} vault key generate ===")));
assert!(help.contains(&format!("=== {binary} account token ===")));
- assert!(help.contains("Manage Ente accounts"));
- assert!(help.contains("Manage Ente Locker"));
- assert!(help.contains("Use this account instead of the selected one"));
- assert!(help.contains("apps (string array); selected (boolean)"));
- assert!(help.contains(
- "This prints a secret and does not check whether the server still accepts it."
- ));
- assert!(help.contains("With --json, returns {\"token\":\"...\"}."));
let missing_app = home
.command(&["account", "token"])
.env("ENTE_CLI_VAULT_KEY", "invalid")
@@ -694,10 +686,6 @@ fn account_token_reads_the_requested_saved_login() {
"--offline",
"--no-input",
];
- assert!(
- failure(&home.run(&args))
- .contains("no accounts; use photos login, locker login, or auth login")
- );
home.seed("http://127.0.0.1:1");
let mut state = home.read_vault();
state["selected"] = Value::Null;