Skip to content

Commit

Permalink
test: more vk bad errors
Browse files Browse the repository at this point in the history
  • Loading branch information
SevereCloud committed Jan 22, 2022
1 parent 0ef1653 commit 5ec50a1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
11 changes: 9 additions & 2 deletions api/market_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package api_test

import (
"errors"
"net/http"
"testing"
"time"
Expand Down Expand Up @@ -105,15 +106,21 @@ func TestVK_MarketAddAlbum(t *testing.T) {
})
noErrorOrFail(t, err)

time.Sleep(sleepTime)
time.Sleep(2 * sleepTime)

_, err = vkUser.MarketReorderItems(api.Params{
"owner_id": -vkGroupID,
"album_id": album.MarketAlbumID,
"item_id": marketID,
"before": marketBeforeID,
})
noErrorOrFail(t, err)
if err != nil {
if errors.Is(err, api.ErrMarketNotEnabled) {
t.Skip("VK bad error: " + err.Error())
} else {
noErrorOrFail(t, err)
}
}

time.Sleep(sleepTime)

Expand Down
7 changes: 6 additions & 1 deletion api/messages_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package api_test

import (
"errors"
"testing"
"time"

Expand Down Expand Up @@ -44,7 +45,11 @@ func TestVK_MessagesDelete(t *testing.T) {
"message_id": msgID,
"message": "Edit message",
})
noError(t, err)
if err != nil {
if !errors.Is(err, api.ErrRequest) {
noError(t, err)
}
}

pin, err := vkUser.MessagesPin(api.Params{
"peer_id": 2000000000 + chatID,
Expand Down

0 comments on commit 5ec50a1

Please sign in to comment.