cleanup & fix ci (#82)

* cleanup readme & examples
* upgrade go version
* add makefile with basic commands
* add e2e test
* add gha
* update .gitignore
This commit is contained in:
Fran
2023-09-29 17:47:28 +02:00
committed by GitHub
parent 029b93e5f0
commit ec40467798
27 changed files with 688 additions and 943 deletions

View File

@@ -1,9 +1,10 @@
package transcoder
import (
"github.com/stretchr/testify/require"
"github.com/xfrr/goffmpeg/models"
"testing"
"github.com/stretchr/testify/require"
"github.com/xfrr/goffmpeg/media"
)
func TestTranscoder(t *testing.T) {
@@ -11,7 +12,7 @@ func TestTranscoder(t *testing.T) {
t.Run("Should not set -protocol_whitelist option if it isn't present", func(t *testing.T) {
ts := Transcoder{}
ts.SetMediaFile(&models.Mediafile{})
ts.SetMediaFile(&media.File{})
require.NotEqual(t, ts.GetCommand()[0:2], []string{"-protocol_whitelist", "file,http,https,tcp,tls"})
require.NotContains(t, ts.GetCommand(), "protocol_whitelist")
})
@@ -19,8 +20,8 @@ func TestTranscoder(t *testing.T) {
t.Run("Should set -protocol_whitelist option if it's present", func(t *testing.T) {
ts := Transcoder{}
ts.SetMediaFile(&models.Mediafile{})
ts.SetWhiteListProtocols([]string{"file","http","https","tcp","tls"})
ts.SetMediaFile(&media.File{})
ts.SetWhiteListProtocols([]string{"file", "http", "https", "tcp", "tls"})
require.Equal(t, ts.GetCommand()[0:2], []string{"-protocol_whitelist", "file,http,https,tcp,tls"})
})