summaryrefslogtreecommitdiffstats
path: root/modules/auth/pam/pam_test.go
blob: 08565d2f312ab5d85202922acd47910da88c7409 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//go:build pam

// Copyright 2021 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.

package pam

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestPamAuth(t *testing.T) {
	result, err := Auth("gitea", "user1", "false-pwd")
	assert.Error(t, err)
	assert.EqualError(t, err, "Authentication failure")
	assert.Len(t, result, 0)
}