Skip to content

Commit 93fc676

Browse files
committed
update sign testcase
1 parent 77de5bb commit 93fc676

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

asyncgit/src/sync/sign.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ impl Sign for GPGSign {
270270

271271
/// Sign commit data using `SSHDiskKeySign`
272272
pub struct SSHSign {
273+
#[cfg(test)]
274+
program: String,
273275
#[cfg(test)]
274276
key_path: String,
275277
secret_key: PrivateKey,
@@ -288,6 +290,8 @@ impl SSHSign {
288290
PrivateKey::from_openssh(bytes).ok()
289291
})
290292
.map(|secret_key| Self {
293+
#[cfg(test)]
294+
program: "ssh".to_string(),
291295
#[cfg(test)]
292296
key_path,
293297
secret_key,
@@ -319,7 +323,7 @@ impl Sign for SSHSign {
319323

320324
#[cfg(test)]
321325
fn program(&self) -> &String {
322-
"ssh"
326+
&self.program
323327
}
324328

325329
#[cfg(test)]
@@ -408,6 +412,7 @@ mod tests {
408412
let sign =
409413
SignBuilder::from_gitconfig(&repo, &repo.config()?)?;
410414

415+
assert_eq!("FFAA", sign.signing_key());
411416
Ok(())
412417
}
413418

@@ -425,7 +430,7 @@ mod tests {
425430
SignBuilder::from_gitconfig(&repo, &repo.config()?)?;
426431

427432
assert_eq!("ssh", sign.program());
428-
assert_eq!("/tmp/key", sign.signing_key());
433+
assert_eq!("/tmp/key.pub", sign.signing_key());
429434

430435
Ok(())
431436
}

0 commit comments

Comments
 (0)