code.gitea.io/gitea@v1.19.3/modules/auth/pam/pam_test.go (about)

     1  //go:build pam
     2  
     3  // Copyright 2021 The Gitea Authors. All rights reserved.
     4  // SPDX-License-Identifier: MIT
     5  
     6  package pam
     7  
     8  import (
     9  	"testing"
    10  
    11  	"github.com/stretchr/testify/assert"
    12  )
    13  
    14  func TestPamAuth(t *testing.T) {
    15  	result, err := Auth("gitea", "user1", "false-pwd")
    16  	assert.Error(t, err)
    17  	assert.EqualError(t, err, "Authentication failure")
    18  	assert.Len(t, result, 0)
    19  }