Skip to content

Commit

Permalink
fixed Test_cmdTrimLengthOfVideo errors now it pass
Browse files Browse the repository at this point in the history
  • Loading branch information
roddy3 committed Apr 15, 2022
1 parent bbb3a19 commit f494d78
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions src/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,33 +203,21 @@ func Test_cmdGetVideoLength(t *testing.T) {
}{
{
"get correct video duration",
args{inputDirectory: "./TestInput/sample_video.mp4"},
args{inputDirectory: "../TestInput/sample_video.mp4"},
// check the command that we are running is the right command.
exec.Command("ffprobe",
"-v", "error",
"-show_entries", "format=duration",
"-of", "default=noprint_wrappers=1:nokey=1",
"./TestInput/sample_video.mp4"),
"../TestInput/sample_video.mp4"),
},
}

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
//cmd := cmdGetVideoLength(tt.args.inputDirectory)
//check if it is equal of what we want

if got := cmdGetVideoLength(tt.args.inputDirectory); got != tt.want {
t.Errorf("cmdGetVideoLength() = %v, want %v", got, tt.want)

if got := cmdGetVideoLength(tt.args.inputDirectory).String(); got != tt.want.String() {
t.Errorf("createZoomCommand() = %v, want %v", got, tt.want)
}
//output, err := cmd.CombinedOutput()
//checkCMDError(output, err)

//video_length, err := strconv.ParseFloat(strings.TrimSpace(string(output)), 8)

// if video_length != tt.want {
// t.Errorf("expected video length of sample_video.mp4 to be %f but got %f", tt.want, video_length)
// }
})
}
}
Expand Down

0 comments on commit f494d78

Please sign in to comment.