Initial import
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#lang racket/base
|
||||
|
||||
(require rackunit
|
||||
"../credentials.rkt")
|
||||
|
||||
;; Never touch the real racket-git preferences from the test suite.
|
||||
(parameterize ([current-git-credentials-store 'racket-git-test]
|
||||
[current-git-credentials-unlock-store 'racket-git-test-unlock])
|
||||
(with-handlers ([exn:fail? (lambda (_) (void))])
|
||||
(git-credentials-lock!))
|
||||
|
||||
(with-handlers ([exn:fail? (lambda (_) (void))])
|
||||
(git-credentials-init! "test-password" #:unlock-for 60))
|
||||
|
||||
(unless (git-credentials-unlocked?)
|
||||
(git-credentials-unlock! "test-password" #:for 60))
|
||||
|
||||
(check-true (git-credentials-unlocked?))
|
||||
(git-credentials-set! "https://credentials-test.invalid"
|
||||
"tester" "secret-token")
|
||||
(check-equal?
|
||||
(git-credentials-ref "https://credentials-test.invalid")
|
||||
'("tester" . "secret-token"))
|
||||
(check-equal?
|
||||
(git-credentials-ref "https://credentials-test.invalid/a/b.git")
|
||||
'("tester" . "secret-token"))
|
||||
(git-credentials-remove! "https://credentials-test.invalid")
|
||||
(check-false (git-credentials-ref "https://credentials-test.invalid"))
|
||||
(git-credentials-lock!)
|
||||
(check-false (git-credentials-unlocked?)))
|
||||
Reference in New Issue
Block a user