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 442B

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