| 1 | import unittest |
| 2 | from unittest import mock |
| 3 | |
| 4 | from auth0.authentication.users import Users |
| 5 | |
| 6 | |
| 7 | class TestUsers(unittest.TestCase): |
| 8 | @mock.patch("auth0.authentication.rest.RestClient.get") |
| 9 | def test_userinfo(self, mock_get): |
| 10 | u = Users("my.domain.com") |
| 11 | |
| 12 | u.userinfo(access_token="atk") |
| 13 | |
| 14 | mock_get.assert_called_with( |
| 15 | url="https://my.domain.com/userinfo", |
| 16 | headers={"Authorization": "Bearer atk"}, |
| 17 | ) |