Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make starrtest submodule #89

Merged
merged 2 commits into from
Dec 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ issues:
- funlen
- maintidx # uhg.
path: '(.+)_test\.go'
- linters:
- lll
path: 'starrtest/'

linters:
enable-all: true
Expand Down
5 changes: 3 additions & 2 deletions lidarr/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ import (
"github.com/stretchr/testify/assert"
"golift.io/starr"
"golift.io/starr/lidarr"
"golift.io/starr/starrtest"
)

func TestGetCommands(t *testing.T) {
t.Parallel()

somedate := time.Now().Add(-36 * time.Hour).Round(time.Millisecond).UTC()
datejson, _ := somedate.MarshalJSON()
tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "200",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "command"),
Expand Down Expand Up @@ -78,7 +79,7 @@ func TestSendCommand(t *testing.T) {

somedate := time.Now().Add(-36 * time.Hour).Round(time.Millisecond).UTC()
datejson, _ := somedate.MarshalJSON()
tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "200",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "command"),
Expand Down
11 changes: 6 additions & 5 deletions lidarr/downloadclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/stretchr/testify/assert"
"golift.io/starr"
"golift.io/starr/lidarr"
"golift.io/starr/starrtest"
)

const downloadClientResponseBody = `{
Expand Down Expand Up @@ -64,7 +65,7 @@ const updateDownloadClient = `{"enable":true,"removeCompletedDownloads":false,"r
func TestGetDownloadClients(t *testing.T) {
t.Parallel()

tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "200",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "downloadClient"),
Expand Down Expand Up @@ -143,7 +144,7 @@ func TestGetDownloadClients(t *testing.T) {
func TestGetDownloadClient(t *testing.T) {
t.Parallel()

tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "200",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "downloadClient", "1"),
Expand Down Expand Up @@ -220,7 +221,7 @@ func TestGetDownloadClient(t *testing.T) {
func TestAddDownloadClient(t *testing.T) {
t.Parallel()

tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "200",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "downloadClient"),
Expand Down Expand Up @@ -345,7 +346,7 @@ func TestAddDownloadClient(t *testing.T) {
func TestUpdateDownloadClient(t *testing.T) {
t.Parallel()

tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "200",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "downloadClient", "3"),
Expand Down Expand Up @@ -472,7 +473,7 @@ func TestUpdateDownloadClient(t *testing.T) {
func TestDeleteDownloadClient(t *testing.T) {
t.Parallel()

tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "200",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "downloadClient", "2"),
Expand Down
5 changes: 3 additions & 2 deletions lidarr/downloadclientconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/stretchr/testify/assert"
"golift.io/starr"
"golift.io/starr/lidarr"
"golift.io/starr/starrtest"
)

const downloadClientConfigBody = `{
Expand All @@ -19,7 +20,7 @@ const downloadClientConfigBody = `{
func TestGetDownloadClientConfig(t *testing.T) {
t.Parallel()

tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "200",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "config", "downloadClient"),
Expand Down Expand Up @@ -63,7 +64,7 @@ func TestGetDownloadClientConfig(t *testing.T) {
func TestUpdateDownloadClientConfig(t *testing.T) {
t.Parallel()

tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "202",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "config", "downloadClient", "1"),
Expand Down
11 changes: 6 additions & 5 deletions lidarr/indexer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/stretchr/testify/assert"
"golift.io/starr"
"golift.io/starr/lidarr"
"golift.io/starr/starrtest"
)

const indexerResponseBody = `{
Expand Down Expand Up @@ -58,7 +59,7 @@ const updateIndexer = `{"enableAutomaticSearch":true,"enableInteractiveSearch":t
func TestGetIndexers(t *testing.T) {
t.Parallel()

tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "200",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "indexer"),
Expand Down Expand Up @@ -133,7 +134,7 @@ func TestGetIndexers(t *testing.T) {
func TestGetIndexer(t *testing.T) {
t.Parallel()

tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "200",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "indexer", "1"),
Expand Down Expand Up @@ -206,7 +207,7 @@ func TestGetIndexer(t *testing.T) {
func TestAddIndexer(t *testing.T) {
t.Parallel()

tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "200",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "indexer"),
Expand Down Expand Up @@ -321,7 +322,7 @@ func TestAddIndexer(t *testing.T) {
func TestUpdateIndexer(t *testing.T) {
t.Parallel()

tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "200",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "indexer", "1"),
Expand Down Expand Up @@ -438,7 +439,7 @@ func TestUpdateIndexer(t *testing.T) {
func TestDeleteIndexer(t *testing.T) {
t.Parallel()

tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "200",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "indexer", "2"),
Expand Down
5 changes: 3 additions & 2 deletions lidarr/indexerconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/stretchr/testify/assert"
"golift.io/starr"
"golift.io/starr/lidarr"
"golift.io/starr/starrtest"
)

const indexerConfigBody = `{
Expand All @@ -20,7 +21,7 @@ const indexerConfigBody = `{
func TestGetIndexerConfig(t *testing.T) {
t.Parallel()

tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "200",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "config", "indexer"),
Expand Down Expand Up @@ -63,7 +64,7 @@ func TestGetIndexerConfig(t *testing.T) {
func TestUpdateIndexerConfig(t *testing.T) {
t.Parallel()

tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "202",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "config", "indexer", "1"),
Expand Down
11 changes: 6 additions & 5 deletions lidarr/notification_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/stretchr/testify/assert"
"golift.io/starr"
"golift.io/starr/lidarr"
"golift.io/starr/starrtest"
)

const notificationResponseBody = `{
Expand Down Expand Up @@ -70,7 +71,7 @@ const updateNotification = `{"onUpgrade":true,"id":3,"name":"Test","implementati
func TestGetNotifications(t *testing.T) {
t.Parallel()

tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "200",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "notification"),
Expand Down Expand Up @@ -148,7 +149,7 @@ func TestGetNotifications(t *testing.T) {
func TestGetNotification(t *testing.T) {
t.Parallel()

tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "200",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "notification", "1"),
Expand Down Expand Up @@ -224,7 +225,7 @@ func TestGetNotification(t *testing.T) {
func TestAddNotification(t *testing.T) {
t.Parallel()

tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "200",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "notification"),
Expand Down Expand Up @@ -324,7 +325,7 @@ func TestAddNotification(t *testing.T) {
func TestUpdateNotification(t *testing.T) {
t.Parallel()

tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "200",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "notification", "3"),
Expand Down Expand Up @@ -426,7 +427,7 @@ func TestUpdateNotification(t *testing.T) {
func TestDeleteNotification(t *testing.T) {
t.Parallel()

tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "200",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "notification", "2"),
Expand Down
11 changes: 6 additions & 5 deletions lidarr/remotepathmapping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/stretchr/testify/assert"
"golift.io/starr"
"golift.io/starr/lidarr"
"golift.io/starr/starrtest"
)

const (
Expand All @@ -21,7 +22,7 @@ const (
func TestGetRemotePathMappings(t *testing.T) {
t.Parallel()

tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "200",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "remotePathMapping"),
Expand Down Expand Up @@ -65,7 +66,7 @@ func TestGetRemotePathMappings(t *testing.T) {
func TestGetRemotePathMapping(t *testing.T) {
t.Parallel()

tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "200",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "remotePathMapping", "1"),
Expand Down Expand Up @@ -109,7 +110,7 @@ func TestGetRemotePathMapping(t *testing.T) {
func TestAddRemotePathMapping(t *testing.T) {
t.Parallel()

tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "201",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "remotePathMapping"),
Expand Down Expand Up @@ -163,7 +164,7 @@ func TestAddRemotePathMapping(t *testing.T) {
func TestUpdateRemotePathMapping(t *testing.T) {
t.Parallel()

tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "201",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "remotePathMapping", "2"),
Expand Down Expand Up @@ -219,7 +220,7 @@ func TestUpdateRemotePathMapping(t *testing.T) {
func TestDeleteRemotePathMapping(t *testing.T) {
t.Parallel()

tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "200",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "remotePathMapping", "2"),
Expand Down
11 changes: 6 additions & 5 deletions lidarr/tag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import (
"github.com/stretchr/testify/assert"
"golift.io/starr"
"golift.io/starr/lidarr"
"golift.io/starr/starrtest"
)

func TestGetTags(t *testing.T) {
t.Parallel()

tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "200",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "tag"),
Expand Down Expand Up @@ -58,7 +59,7 @@ func TestGetTags(t *testing.T) {
func TestGetTag(t *testing.T) {
t.Parallel()

tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "200",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "tag", "1"),
Expand Down Expand Up @@ -100,7 +101,7 @@ func TestGetTag(t *testing.T) {
func TestAddTag(t *testing.T) {
t.Parallel()

tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "200",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "tag"),
Expand Down Expand Up @@ -148,7 +149,7 @@ func TestAddTag(t *testing.T) {
func TestUpdateTag(t *testing.T) {
t.Parallel()

tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "200",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "tag", "1"),
Expand Down Expand Up @@ -198,7 +199,7 @@ func TestUpdateTag(t *testing.T) {
func TestDeleteTag(t *testing.T) {
t.Parallel()

tests := []*starr.TestMockData{
tests := []*starrtest.MockData{
{
Name: "200",
ExpectedPath: path.Join("/", starr.API, lidarr.APIver, "tag", "1"),
Expand Down
Loading