diff options
Diffstat (limited to 'integration_test.go')
-rw-r--r-- | integration_test.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/integration_test.go b/integration_test.go index fb0a785..88ecfa6 100644 --- a/integration_test.go +++ b/integration_test.go @@ -7,6 +7,8 @@ package main import ( + "bytes" + "io/ioutil" "math/rand" "strconv" "strings" @@ -653,6 +655,32 @@ func TestExport(t *testing.T) { } } +func TestImport(t *testing.T) { + username := getRandomUsername() + client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword) + _, err := client.CreateUser(username, testStandardPassword, false) + if err != nil { + t.Fatal(err) + } + + client = miniflux.NewClient(testBaseURL, username, testStandardPassword) + + data := `<?xml version="1.0" encoding="UTF-8"?> + <opml version="2.0"> + <body> + <outline text="Test Category"> + <outline title="Test" text="Test" xmlUrl="` + testFeedURL + `" htmlUrl="` + testWebsiteURL + `"></outline> + </outline> + </body> + </opml>` + + b := bytes.NewReader([]byte(data)) + err = client.Import(ioutil.NopCloser(b)) + if err != nil { + t.Fatal(err) + } +} + func TestUpdateFeed(t *testing.T) { username := getRandomUsername() client := miniflux.NewClient(testBaseURL, testAdminUsername, testAdminPassword) |