File: test_enterprise.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 (27 lines) | stat: -rw-r--r-- 789 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
import unittest
from unittest import mock

from ...authentication.enterprise import Enterprise


class TestEnterprise(unittest.TestCase):
    @mock.patch("auth0.authentication.enterprise.Enterprise.get")
    def test_saml_metadata(self, mock_get):
        e = Enterprise("my.domain.com", "cid")

        e.saml_metadata()

        mock_get.assert_called_with(url="https://my.domain.com/samlp/metadata/cid")

    @mock.patch("auth0.authentication.enterprise.Enterprise.get")
    def test_wsfed_metadata(self, mock_get):
        e = Enterprise("my.domain.com", "cid")

        e.wsfed_metadata()

        mock_get.assert_called_with(
            url=(
                "https://my.domain.com/wsfed/FederationMetadata"
                "/2007-06/FederationMetadata.xml"
            )
        )