forked from zerodha/gokiteconnect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser_test.go
34 lines (28 loc) · 836 Bytes
/
user_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
package kiteconnect
import (
"testing"
)
func (ts *TestSuite) TestGetUserProfile(t *testing.T) {
profile, err := ts.KiteConnect.GetUserProfile()
if err != nil || profile.Email == "" {
t.Errorf("Error while reading user profile. Error: %v", err)
}
}
func (ts *TestSuite) TestGetUserMargins(t *testing.T) {
margins, err := ts.KiteConnect.GetUserMargins()
if err != nil {
t.Errorf("Error while reading user margins. Error: %v", err)
}
if !margins.Equity.Enabled || !margins.Commodity.Enabled {
t.Errorf("Incorrect margin values.")
}
}
func (ts *TestSuite) TestGetUserSegmentMargins(t *testing.T) {
margins, err := ts.KiteConnect.GetUserSegmentMargins("test")
if err != nil {
t.Errorf("Error while reading user margins. Error: %v", err)
}
if !margins.Enabled {
t.Errorf("Incorrect segment margin values.")
}
}