Add TestCmdXSearch and TestCmdMikami

This commit is contained in:
178inaba 2017-05-03 03:05:36 +09:00
parent a796ca03c5
commit d0504fea0f
3 changed files with 58 additions and 0 deletions

View file

@ -7,8 +7,24 @@ import (
"net/http/httptest"
"strings"
"testing"
"github.com/urfave/cli"
)
func TestCmdXSearch(t *testing.T) {
testWithServer(
func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, `<div class="post"><div class="mst_content"><a href="http://example.com/@test/1"><p>test status</p></a></div></div>`)
},
func(app *cli.App) {
err := app.Run([]string{"mstdn", "xsearch", "test"})
if err != nil {
t.Fatalf("should not be fail: %v", err)
}
},
)
}
func TestXSearch(t *testing.T) {
canErr := true
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {