1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2024-11-24 08:52:25 +02:00
oauth2-proxy/htpasswd_test.go
Jehiah Czebotar 42f539109e testing
2012-12-17 13:38:33 -05:00

17 lines
322 B
Go

package main
import (
"bytes"
"github.com/bmizerany/assert"
"testing"
)
func TestHtpasswd(t *testing.T) {
file := bytes.NewBuffer([]byte("testuser:{SHA}PaVBVZkYqAjCQCu6UBL2xgsnZhw=\n"))
h, err := NewHtpasswd(file)
assert.Equal(t, err, nil)
valid := h.Validate("testuser", "asdf")
assert.Equal(t, valid, true)
}