-
Notifications
You must be signed in to change notification settings - Fork 0
/
commands_int_test.go
60 lines (43 loc) · 1.1 KB
/
commands_int_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// +build integration
package main
import (
"os"
"os/exec"
"testing"
)
func Test_unzipFile(t *testing.T) {
pathTmp = "./test"
os.Mkdir(pathTmp, os.ModePerm)
file1 := "./test_data/file1.gz"
file2 := "./test/fileTmp.gz"
c := exec.Command("cp", file1, file2)
if err := c.Run(); err != nil {
t.Errorf("error retrieve file (delete folder): %v", err)
}
fileName, err := unzipFile(file2)
if fileName != "./test/fileTmp" {
t.Errorf("wrong fileName: %s", fileName)
}
if err != nil {
t.Errorf("error retrieve file: %v", err)
}
//time.Sleep(1 * time.Second)
c = exec.Command("rm", "-R", pathTmp)
if err := c.Run(); err != nil {
t.Errorf("error retrieve file (delete folder): %v", err)
}
}
func Test_processFilesWithTeqc(t *testing.T) {
file1 := "./test_data/file1"
bs := "example"
files := []string{file1}
err := processFilesWithTeqc(files, bs)
if err != nil {
t.Errorf("error process files with teqc: %v", err)
}
//time.Sleep(1 * time.Second)
c := exec.Command("rm", bs+".obs")
if err := c.Run(); err != nil {
t.Errorf("error process files with teqc (delete file): %v", err)
}
}