| 1 | import unittest |
| 2 | from unittest import mock |
| 3 | |
| 4 | from auth0.authentication.enterprise import Enterprise |
| 5 | |
| 6 | |
| 7 | class TestEnterprise(unittest.TestCase): |
| 8 | @mock.patch("auth0.authentication.enterprise.Enterprise.get") |
| 9 | def test_saml_metadata(self, mock_get): |
| 10 | e = Enterprise("my.domain.com", "cid") |
| 11 | |
| 12 | e.saml_metadata() |
| 13 | |
| 14 | mock_get.assert_called_with(url="https://my.domain.com/samlp/metadata/cid") |
| 15 | |
| 16 | @mock.patch("auth0.authentication.enterprise.Enterprise.get") |
| 17 | def test_wsfed_metadata(self, mock_get): |
| 18 | e = Enterprise("my.domain.com", "cid") |
| 19 | |
| 20 | e.wsfed_metadata() |
| 21 | |
| 22 | mock_get.assert_called_with( |
| 23 | url=( |
| 24 | "https://my.domain.com/wsfed/FederationMetadata" |
| 25 | "/2007-06/FederationMetadata.xml" |
| 26 | ) |
| 27 | ) |