-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvalidation_test.py
73 lines (58 loc) · 3.1 KB
/
validation_test.py
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
64
65
66
67
68
69
70
71
72
73
import unittest
import sailpoint.v2024
import sailpoint.v3
import sailpoint.beta
from sailpoint.v3.models.search import Search
from sailpoint.configuration import Configuration
from sailpoint.paginator import Paginator
class TestPythonSDK(unittest.TestCase):
configuration = Configuration()
v3_api_client = sailpoint.v3.ApiClient(configuration)
beta_api_client = sailpoint.beta.ApiClient(configuration)
configuration.experimental = True
v2024_api_client = sailpoint.v2024.ApiClient(configuration)
def test_v3_accounts(self):
accounts = sailpoint.v3.AccountsApi(self.v3_api_client).list_accounts_with_http_info()
self.assertIsNotNone(accounts.data)
self.assertEqual(200, accounts.status_code)
def test_search_pagination(self):
search = Search()
search.indices = ['identities']
search.query = { 'query': '*' }
search.sort = ['-name']
search_results = Paginator.paginate_search_with_http_info(sailpoint.v3.SearchApi(self.v3_api_client), search, 10, 100)
self.assertIsNotNone(search_results)
self.assertEqual(100,len(search_results.data))
self.assertEqual(200,search_results.status_code)
def test_list_transforms(self):
transforms = sailpoint.v3.TransformsApi(self.v3_api_client).list_transforms_with_http_info()
self.assertIsNotNone(transforms.data)
self.assertEqual(200, transforms.status_code)
def test_pagination(self):
accounts = Paginator.paginate(sailpoint.v3.AccountsApi(self.v3_api_client).list_accounts_with_http_info, 100, limit=10)
self.assertIsNotNone(accounts.data)
self.assertEqual(100, len(accounts.data))
self.assertEqual(200, accounts.status_code)
def test_list_accounts_beta(self):
accounts = sailpoint.beta.AccountsApi(self.beta_api_client).list_accounts_with_http_info()
self.assertIsNotNone(accounts.data)
self.assertEqual(200, accounts.status_code)
def test_list_connectors_beta(self):
connectors = sailpoint.beta.ConnectorsApi(self.beta_api_client).get_connector_list_with_http_info()
self.assertIsNotNone(connectors.data)
self.assertEqual(200, connectors.status_code)
def test_list_sources_beta(self):
sources = sailpoint.beta.SourcesApi(self.beta_api_client).list_sources_with_http_info()
self.assertIsNotNone(sources.data)
self.assertEqual(200, sources.status_code)
def test_pagination_with_beta_endpoint(self):
identity_profiles = Paginator.paginate(sailpoint.beta.IdentityProfilesApi(self.beta_api_client).list_identity_profiles_with_http_info, 2, limit=1)
self.assertIsNotNone(identity_profiles.data)
self.assertEqual(200, identity_profiles.status_code)
self.assertEqual(2, len(identity_profiles.data))
def test_list_identities_with_v2024_endpoint(self):
identities = sailpoint.v2024.IdentitiesApi(self.v2024_api_client).list_identities_with_http_info()
self.assertIsNotNone(identities.data)
self.assertEqual(200, identities.status_code)
if __name__ == '__main__':
unittest.main()