audio: increase test coverage
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
parent
d63e5b3d9b
commit
a2d76749ca
|
@ -3,6 +3,7 @@ package audio
|
|||
|
||||
import (
|
||||
"os/exec"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"gobot.io/x/gobot"
|
||||
|
@ -18,6 +19,13 @@ func TestAudioAdaptor(t *testing.T) {
|
|||
gobottest.Assert(t, a.Finalize(), nil)
|
||||
}
|
||||
|
||||
func TestAudioAdaptorName(t *testing.T) {
|
||||
a := NewAdaptor()
|
||||
gobottest.Assert(t, strings.HasPrefix(a.Name(), "Audio"), true)
|
||||
a.SetName("NewName")
|
||||
gobottest.Assert(t, a.Name(), "NewName")
|
||||
}
|
||||
|
||||
func TestAudioAdaptorCommandsWav(t *testing.T) {
|
||||
cmd, _ := CommandName("whatever.wav")
|
||||
gobottest.Assert(t, cmd, "aplay")
|
||||
|
|
|
@ -4,6 +4,7 @@ package audio
|
|||
|
||||
import (
|
||||
"os/exec"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"gobot.io/x/gobot"
|
||||
|
@ -24,6 +25,13 @@ func TestAudioDriver(t *testing.T) {
|
|||
gobottest.Assert(t, d.Halt(), nil)
|
||||
}
|
||||
|
||||
func TestAudioDriverName(t *testing.T) {
|
||||
d := NewDriver(NewAdaptor(), "")
|
||||
gobottest.Assert(t, strings.HasPrefix(d.Name(), "Audio"), true)
|
||||
d.SetName("NewName")
|
||||
gobottest.Assert(t, d.Name(), "NewName")
|
||||
}
|
||||
|
||||
func TestAudioDriverSoundWithNoFilename(t *testing.T) {
|
||||
d := NewDriver(NewAdaptor(), "")
|
||||
|
||||
|
|
Loading…
Reference in New Issue