Fix TestGetProfileErrorNotFound
This commit is contained in:
parent
da34364bf9
commit
c20fd24e9b
1 changed files with 6 additions and 3 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
package twitterscraper
|
package twitterscraper
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
|
@ -120,12 +121,14 @@ func TestGetProfileErrorSuspended(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestGetProfileErrorNotFound(t *testing.T) {
|
func TestGetProfileErrorNotFound(t *testing.T) {
|
||||||
_, err := GetProfile("sample3123131")
|
neUser := "sample3123131"
|
||||||
|
expectedError := fmt.Sprintf("User '%s' not found", neUser)
|
||||||
|
_, err := GetProfile(neUser)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Error("Expected Error, got success")
|
t.Error("Expected Error, got success")
|
||||||
} else {
|
} else {
|
||||||
if err.Error() != "Not found" {
|
if err.Error() != expectedError {
|
||||||
t.Errorf("Expected error 'Not found', got '%s'", err)
|
t.Errorf("Expected error '%s', got '%s'", expectedError, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue