From 4cc027a139396742983405782ab70a766dcaffb0 Mon Sep 17 00:00:00 2001 From: Tad Fisher Date: Mon, 20 Mar 2017 10:55:45 -0700 Subject: Generate default passname from URI label; remove url param --- test/insert.t | 91 +++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 58 insertions(+), 33 deletions(-) (limited to 'test/insert.t') diff --git a/test/insert.t b/test/insert.t index b4af4f5..e0d2441 100755 --- a/test/insert.t +++ b/test/insert.t @@ -4,87 +4,112 @@ export test_description="Tests pass otp insert commands" . ./setup.sh -test_expect_success 'Inserts a key URI' ' +test_expect_success 'Reads non-terminal input' ' uri="otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example" test_pass_init && - "$PASS" otp insert "$uri" passfile && + "$PASS" otp insert passfile <<< "$uri" && [[ $("$PASS" show passfile) == "$uri" ]] ' -test_expect_success 'Prompts before overwriting key URI' ' - uri1="otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Foo" - uri2="otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Bar" +test_expect_success 'Reads terminal input in noecho mode' ' + uri="otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example" test_pass_init - "$PASS" otp insert "$uri1" passfile expect <