summaryrefslogtreecommitdiffstats
path: root/modules/auth/pam/pam_test.go
blob: e9b844e955a00ea2daa4424d47a4c8b147eb8fc8 (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.
// SPDX-License-Identifier: MIT

package pam

import (
	"testing"

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

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