This repository was archived by the owner on Oct 1, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 2727# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828import pkg_resources
2929
30+ from servicex .resources .servicex_resource import ServiceXResource
31+ from tests .resource_test_base import ResourceTestBase
3032
31- class TestServiceXResource :
33+
34+ class TestServiceXResource (ResourceTestBase ):
3235 def test_get_app_version_no_servicex_app (self , mocker ):
3336 mock_get_distribution = mocker .patch (
3437 "servicex.resources.servicex_resource.pkg_resources.get_distribution" ,
3538 side_effect = pkg_resources .DistributionNotFound (None , None ))
3639
37- from servicex .resources .servicex_resource import ServiceXResource
3840 version = ServiceXResource ._get_app_version ()
3941
4042 mock_get_distribution .assert_called_with ("servicex_app" )
4143 assert version == 'develop'
44+
45+ def test_get_requesting_user_no_auth (self , client ):
46+ with client .application .app_context ():
47+ assert ServiceXResource .get_requesting_user () is None
48+
49+ def test_get_requesting_user_with_auth (self , mock_requesting_user ):
50+ client = self ._test_client (extra_config = {'ENABLE_AUTH' : True })
51+ with client .application .app_context ():
52+ assert ServiceXResource .get_requesting_user () == mock_requesting_user
You can’t perform that action at this time.
0 commit comments