aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMorten Linderud <morten@linderud.pw>2018-12-02 16:02:15 +0100
committerTad Fisher <129148+tadfisher@users.noreply.github.com>2020-09-12 12:43:42 -0700
commit6328ba84dba608209cece19dd08a1af76bd57fe8 (patch)
treef7af0def9048272801e43823bd1fe6f5f06ab260 /test
parent47acf1407c282969e6e71b09ac4d2a5d41731475 (diff)
downloadpass-otp-6328ba84dba608209cece19dd08a1af76bd57fe8.tar.gz
pass-otp-6328ba84dba608209cece19dd08a1af76bd57fe8.zip
Added docs, test and completion
Diffstat (limited to 'test')
-rwxr-xr-xtest/insert.t18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/insert.t b/test/insert.t
index a8c6458..938a6dd 100755
--- a/test/insert.t
+++ b/test/insert.t
@@ -139,4 +139,22 @@ test_expect_success 'Tolerates padding in secret' '
echo [[ $("$PASS" show Example/alice@google.com) == "$uri" ]]
'
+test_expect_success 'Allow path prefixes in insert' '
+ secret="JBSWY3DPEHPK3PXP=="
+ uri="otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example"
+
+ test_pass_init &&
+ "$PASS" otp insert -s -p totp -i Example -a alice@google.com <<< "$secret" &&
+ echo [[ $("$PASS" show totp/Example/alice@google.com) == "$uri" ]]
+'
+
+test_expect_success 'Allow multiple levels in path prefix' '
+ secret="JBSWY3DPEHPK3PXP=="
+ uri="otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example"
+
+ test_pass_init &&
+ "$PASS" otp insert -s -p totp/pass-test -i Example -a alice@google.com <<< "$secret" &&
+ echo [[ $("$PASS" show totp/pass-test/Example/alice@google.com) == "$uri" ]]
+'
+
test_done