-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_test.go
63 lines (53 loc) · 1.27 KB
/
main_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
61
62
63
package meocloudcli
import (
"testing"
"os"
)
func TestGet_metadata(t *testing.T) {
path := "/"
want := 200
_, status := Get_metadata(path)
if status != want {
t.Errorf("get_metadata(%s) returned %d, want %d", path, status, want)
}
}
func Test_account_info(t *testing.T) {
want := 200
_, status := Account_info()
if status != want {
t.Errorf("account_info() returned %d, want %d", status, want)
}
}
func Test_get_file(t *testing.T) {
path := "IMG_20220711_083355.jpg"
want := 200
content, status := Get_file(path)
os.WriteFile(path, content, 0644)
if status != want {
t.Errorf("get_file(%s) returned %d, want %d", path, status, want)
}
}
func Test_send_file(t *testing.T) {
filepath := "main.go"
want := 200
status := Send_file(filepath)
if status != want {
t.Errorf("send_file(%s) returned %d, want %d", filepath, status, want)
}
}
func Test_delete_file(t *testing.T) {
filepath := "main.go"
want := 200
status := Delete_file(filepath)
if status != want {
t.Errorf("delete_file(%s) returned %d, want %d", filepath, status, want)
}
}
func Test_create_dir(t *testing.T) {
folderpath := "go_created_me"
want := 403
status := Create_dir(folderpath)
if status != want {
t.Errorf("create_dir(%s) returned %d, want %d", folderpath, status, want)
}
}