fix error tests
This commit is contained in:
parent
a611486a08
commit
3bfec2211f
2 changed files with 21 additions and 8 deletions
|
|
@ -1,7 +1,6 @@
|
|||
package twitterscraper_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
|
@ -116,15 +115,15 @@ func TestGetProfileErrorSuspended(t *testing.T) {
|
|||
if err == nil {
|
||||
t.Error("Expected Error, got success")
|
||||
} else {
|
||||
if !strings.Contains(err.Error(), "Missing LdapGroup(visibility-custom-suspension)") {
|
||||
t.Error("Expected error to contain 'Missing LdapGroup(visibility-custom-suspension)', got", err)
|
||||
if !strings.Contains(err.Error(), "suspended") {
|
||||
t.Error("Expected error to contain 'suspended', got", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetProfileErrorNotFound(t *testing.T) {
|
||||
neUser := "sample3123131"
|
||||
expectedError := fmt.Sprintf("User '%s' not found", neUser)
|
||||
expectedError := "user not found"
|
||||
_, err := testScraper.GetProfile(neUser)
|
||||
if err == nil {
|
||||
t.Error("Expected Error, got success")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue