forked from mmitton/ldap
-
Notifications
You must be signed in to change notification settings - Fork 4
/
add_test.go
54 lines (50 loc) · 1.01 KB
/
add_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
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package ldap
import (
//"encoding/hex"
"fmt"
//"github.com/mavricknz/asn1-ber"
"testing"
//"bytes"
)
var addDNs []string = []string{"cn=Jon Boy,ou=People,dc=example,dc=com"}
var addAttrs []EntryAttribute = []EntryAttribute{
EntryAttribute{
Name: "objectclass",
Values: []string{
"person", "inetOrgPerson", "organizationalPerson", "top",
},
},
EntryAttribute{
Name: "cn",
Values: []string{
"Jon Boy",
},
},
EntryAttribute{
Name: "givenName",
Values: []string{
"Jon",
},
},
EntryAttribute{
Name: "sn",
Values: []string{
"Boy",
},
},
}
// Just testing structure and basic dump.
func TestAdd(t *testing.T) {
fmt.Println("TestAdd starting...")
for _, dn := range addDNs {
addReq := NewAddRequest(dn)
for _, attr := range addAttrs {
addReq.AddAttribute(&attr)
}
fmt.Print(addReq)
}
fmt.Println("TestAdd finsished.")
}