You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pam_test.go 456B

123456789101112131415161718192021
  1. //go:build pam
  2. // +build pam
  3. // Copyright 2021 The Gitea Authors. All rights reserved.
  4. // Use of this source code is governed by a MIT-style
  5. // license that can be found in the LICENSE file.
  6. package pam
  7. import (
  8. "testing"
  9. "github.com/stretchr/testify/assert"
  10. )
  11. func TestPamAuth(t *testing.T) {
  12. result, err := Auth("gitea", "user1", "false-pwd")
  13. assert.Error(t, err)
  14. assert.EqualError(t, err, "Authentication failure")
  15. assert.Len(t, result, 0)
  16. }