File: test_auth0.py

package info (click to toggle)
auth0-python 4.13.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,280 kB
  • sloc: python: 8,933; makefile: 15; sh: 2
file content (136 lines) | stat: -rw-r--r-- 4,699 bytes parent folder | download
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
import unittest

from ...management.actions import Actions
from ...management.attack_protection import AttackProtection
from ...management.auth0 import Auth0
from ...management.blacklists import Blacklists
from ...management.client_credentials import ClientCredentials
from ...management.client_grants import ClientGrants
from ...management.clients import Clients
from ...management.connections import Connections
from ...management.custom_domains import CustomDomains
from ...management.device_credentials import DeviceCredentials
from ...management.email_templates import EmailTemplates
from ...management.emails import Emails
from ...management.grants import Grants
from ...management.guardian import Guardian
from ...management.hooks import Hooks
from ...management.jobs import Jobs
from ...management.log_streams import LogStreams
from ...management.logs import Logs
from ...management.network_acls import NetworkAcls
from ...management.organizations import Organizations
from ...management.prompts import Prompts
from ...management.resource_servers import ResourceServers
from ...management.roles import Roles
from ...management.rules import Rules
from ...management.rules_configs import RulesConfigs
from ...management.stats import Stats
from ...management.tenants import Tenants
from ...management.tickets import Tickets
from ...management.user_blocks import UserBlocks
from ...management.users import Users
from ...management.users_by_email import UsersByEmail
from ...rest import RestClientOptions


class TestAuth0(unittest.TestCase):
    def setUp(self):
        self.domain = "user.some.domain"
        self.token = "a-token"
        self.a0 = Auth0(self.domain, self.token)

    def test_actions(self):
        self.assertIsInstance(self.a0.actions, Actions)

    def test_attack_protection(self):
        self.assertIsInstance(self.a0.attack_protection, AttackProtection)

    def test_blacklists(self):
        self.assertIsInstance(self.a0.blacklists, Blacklists)

    def test_client_credentials(self):
        self.assertIsInstance(self.a0.client_credentials, ClientCredentials)

    def test_client_grants(self):
        self.assertIsInstance(self.a0.client_grants, ClientGrants)

    def test_clients(self):
        self.assertIsInstance(self.a0.clients, Clients)

    def test_connections(self):
        self.assertIsInstance(self.a0.connections, Connections)

    def test_custom_domains(self):
        self.assertIsInstance(self.a0.custom_domains, CustomDomains)

    def test_device_credentials(self):
        self.assertIsInstance(self.a0.device_credentials, DeviceCredentials)

    def test_email_templates(self):
        self.assertIsInstance(self.a0.email_templates, EmailTemplates)

    def test_emails(self):
        self.assertIsInstance(self.a0.emails, Emails)

    def test_grants(self):
        self.assertIsInstance(self.a0.grants, Grants)

    def test_guardian(self):
        self.assertIsInstance(self.a0.guardian, Guardian)

    def test_hooks(self):
        self.assertIsInstance(self.a0.hooks, Hooks)

    def test_jobs(self):
        self.assertIsInstance(self.a0.jobs, Jobs)

    def test_log_streams(self):
        self.assertIsInstance(self.a0.log_streams, LogStreams)

    def test_logs(self):
        self.assertIsInstance(self.a0.logs, Logs)
    
    def test_network_acls(self):
        self.assertIsInstance(self.a0.network_acls, NetworkAcls)

    def test_organizations(self):
        self.assertIsInstance(self.a0.organizations, Organizations)

    def test_prompts(self):
        self.assertIsInstance(self.a0.prompts, Prompts)

    def test_resource_servers(self):
        self.assertIsInstance(self.a0.resource_servers, ResourceServers)

    def test_roles(self):
        self.assertIsInstance(self.a0.roles, Roles)

    def test_rules_configs(self):
        self.assertIsInstance(self.a0.rules_configs, RulesConfigs)

    def test_rules(self):
        self.assertIsInstance(self.a0.rules, Rules)

    def test_stats(self):
        self.assertIsInstance(self.a0.stats, Stats)

    def test_tenants(self):
        self.assertIsInstance(self.a0.tenants, Tenants)

    def test_tickets(self):
        self.assertIsInstance(self.a0.tickets, Tickets)

    def test_user_blocks(self):
        self.assertIsInstance(self.a0.user_blocks, UserBlocks)

    def test_users_by_email(self):
        self.assertIsInstance(self.a0.users_by_email, UsersByEmail)

    def test_users(self):
        self.assertIsInstance(self.a0.users, Users)

    def test_args(self):
        rest_options = RestClientOptions(retries=99)
        auth0 = Auth0(self.domain, self.token, rest_options=rest_options)
        self.assertEqual(auth0.users.client.options.retries, 99)