forked from zoom-lib-golang/zoom-lib-golang
-
Notifications
You must be signed in to change notification settings - Fork 1
/
zoom_test.go
47 lines (39 loc) · 839 Bytes
/
zoom_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
package zoom
import (
"fmt"
"net/url"
"os"
"testing"
"time"
)
var (
now Time
nowStr = "2006-01-02T15:04:05-07:00"
today Date
todayStr = "2006-01-02"
urlT URL
urlStr = "https://zoom.us"
)
func TestMain(m *testing.M) {
// set the time value to 2006-01-02T15:04:05-07:00
t, err := time.Parse(time.RFC3339, nowStr)
if err != nil {
fmt.Fprintf(os.Stderr, "error parsing test time %s: %s\n", nowStr, err)
os.Exit(1)
}
now = Time{t}
// set the date value to 2006-01-02
d, err := time.Parse(DateFormat, todayStr)
if err != nil {
fmt.Fprintf(os.Stderr, "error parsing test date %s: %s\n", todayStr, err)
os.Exit(1)
}
today = Date{d}
u, err := url.Parse(urlStr)
if err != nil {
fmt.Fprintf(os.Stderr, "error parsing test url %s: %s\n", urlStr, err)
os.Exit(1)
}
urlT = URL{u}
os.Exit(m.Run())
}