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

testdata: update helptext #182

Closed
wants to merge 2 commits into from
Closed
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
10 changes: 0 additions & 10 deletions application/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
pb "github.com/vishen/go-chromecast/cast/proto"
"github.com/vishen/go-chromecast/playlists"
"github.com/vishen/go-chromecast/storage"
"gopkg.in/ini.v1"
"path/filepath"
)

Expand Down Expand Up @@ -1427,12 +1426,3 @@ func (a *Application) Transcode(contentType string, command string, args ...stri
a.MediaWait()
return nil
}

// plsIterator is an iterator for playlist-files.
// According to https://en.wikipedia.org/wiki/PLS_(file_format),
// The format is case-sensitive and essentially that of an INI file.
// It has entries on the form File1, Title1 etc.
type plsIterator struct {
count int
playlist *ini.Section
}
31 changes: 0 additions & 31 deletions application/application_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ import (
"encoding/json"
"testing"

"fmt"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
"github.com/vishen/go-chromecast/application"
"github.com/vishen/go-chromecast/cast"
mockCast "github.com/vishen/go-chromecast/cast/mocks"
pb "github.com/vishen/go-chromecast/cast/proto"
"path/filepath"
)

var mockAddr = "foo.bar"
Expand Down Expand Up @@ -44,32 +42,3 @@ func TestApplicationStart(t *testing.T) {
app := application.NewApplication(application.WithConnection(conn))
assertions.NoError(app.Start(mockAddr, mockPort))
}

func TestParsePlaylist(t *testing.T) {
var path string
if abs, err := filepath.Abs(filepath.Join("..", "testdata", "indiepop64.pls")); err != nil {
t.Fatal(err)
} else {
path = fmt.Sprintf("file://%v", abs)
}
it, err := application.NewPlaylistIterator(path)
if err != nil {
t.Fatal(err)
}
var wantUrls = []string{
"https://ice4.somafm.com/indiepop-64-aac",
"https://ice2.somafm.com/indiepop-64-aac",
"https://ice1.somafm.com/indiepop-64-aac",
"https://ice6.somafm.com/indiepop-64-aac",
"https://ice5.somafm.com/indiepop-64-aac",
}
for i, want := range wantUrls {
if !it.HasNext() {
t.Fatal("iterator exhausted")
}
have, _ := it.Next()
if have != want {
t.Fatalf("url %d, have %v want %v", i, have, want)
}
}
}
2 changes: 2 additions & 0 deletions testdata/helptext.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ Available Commands:
previous Play the previous available media
restart Restart the currently playing media
rewind Rewind by seconds the currently playing media
scan Scan for chromecast devices
seek Seek by seconds into the currently playing media
seek-to Seek to the <timestamp_in_seconds> in the currently playing media
skipad Skip the currently playing ad on the chromecast
slideshow Play a slideshow of photos
status Current chromecast status
stop Stop casting
togglepause Toggle paused/unpaused state. Aliases: tpause, playpause
transcode Transcode and play media on the chromecast
tts text-to-speech
ui Run the UI
Expand Down
Loading