James Tombleson
0e0058506a
* added feature flags around background workers * background workers are moved to a new package as outputs are starting to get added * package name was updated * updated refs to the new input package * query and sql updates on routes * moved the services and starting to add discord web hook * query update
26 lines
572 B
Go
26 lines
572 B
Go
package input_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/jtom38/newsbot/collector/domain/model"
|
|
"github.com/jtom38/newsbot/collector/services/input"
|
|
)
|
|
|
|
var rssRecord = model.Sources {
|
|
ID: 1,
|
|
Name: "ArsTechnica",
|
|
Url: "https://feeds.arstechnica.com/arstechnica/index",
|
|
}
|
|
|
|
func TestRssClientConstructor(t *testing.T) {
|
|
input.NewRssClient(rssRecord)
|
|
}
|
|
|
|
func TestRssGetFeed(t *testing.T) {
|
|
client := input.NewRssClient(rssRecord)
|
|
feed, err := client.PullFeed()
|
|
if err != nil { t.Error(err) }
|
|
if len(feed.Items) >= 0 { t.Error("failed to collect items from the fees")}
|
|
|
|
} |