github.com/vchain-us/vcn@v0.9.11-0.20210921212052-a2484d23c0b3/pkg/api/auth_test.go (about) 1 /* 2 * Copyright (c) 2018-2020 vChain, Inc. All Rights Reserved. 3 * This software is released under GPL3. 4 * The full license information can be found under: 5 * https://www.gnu.org/licenses/gpl-3.0.en.html 6 * 7 */ 8 9 package api 10 11 import ( 12 "fmt" 13 "testing" 14 ) 15 16 const verifiedUser = "leonardo@vchain.us" 17 18 func TestCheckTokenNoInput(t *testing.T) { 19 token := "" 20 ret, _ := checkToken(token) 21 22 if ret != false { 23 t.Error(fmt.Sprintf(`CheckToken() with empty string input must return false`)) 24 } 25 26 } 27 28 func TestPublisherExists(t *testing.T) { 29 ret, err := checkUserExists(verifiedUser) 30 31 if ret == false || err != nil { 32 t.Error(fmt.Sprintf(`checkUserExists() must return true for infamous <%s>`, verifiedUser)) 33 } 34 35 }