-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathad_test.py
More file actions
58 lines (39 loc) · 1.39 KB
/
ad_test.py
File metadata and controls
58 lines (39 loc) · 1.39 KB
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
###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permission.
#
#
#
__all__ = ["ADTest"]
import tacticenv
import unittest
from pyasm.security import Batch
from pyasm.search import SearchType
from ad_authenticate import ADAuthenticate
class ADTest(unittest.TestCase):
def test_all(my):
authenticate = ADAuthenticate()
# put in a valid user
login_name = 'supervisor'
password = 'tactic'
exists = authenticate.verify(login_name, password)
my.assertEquals(exists, True)
login = SearchType.create("sthpw/login")
login.set_value("login", login_name)
authenticate.add_user_info(login, password)
# check the user data
display_name = authenticate.get_user_data("display_name")
my.assertEquals("Smith, Joe", display_name)
license_type = authenticate.get_user_data("license_type")
#my.assertEquals("user", license_type)
# check the login sobject
license_type = login.get_value("license_type")
#my.assertEquals("user", license_type)
if __name__ == '__main__':
Batch(project_code='unittest')
unittest.main()