1010
1111from rsconnect .actions import (
1212 _verify_server ,
13- are_apis_supported_on_server ,
14- check_server_capabilities ,
1513 create_api_deployment_bundle ,
1614 create_notebook_deployment_bundle ,
1715 deploy_dash_app ,
1816 deploy_python_api ,
1917 deploy_streamlit_app ,
2018 deploy_bokeh_app ,
21- is_conda_supported_on_server ,
2219)
2320from rsconnect .api import RSConnectServer
2421from rsconnect .environment import MakeEnvironment
@@ -36,39 +33,6 @@ def test_verify_server(self):
3633 with self .assertRaises (RSConnectException ):
3734 _verify_server (RSConnectServer ("fake-url" , None ))
3835
39- def test_check_server_capabilities (self ):
40- no_api_support = {"python" : {"api_enabled" : False }}
41- api_support = {"python" : {"api_enabled" : True }}
42-
43- with self .assertRaises (RSConnectException ) as context :
44- check_server_capabilities (None , (are_apis_supported_on_server ,), lambda x : no_api_support )
45- self .assertEqual (
46- str (context .exception ),
47- "The Posit Connect server does not allow for Python APIs." ,
48- )
49-
50- check_server_capabilities (None , (are_apis_supported_on_server ,), lambda x : api_support )
51-
52- no_conda = api_support
53- conda_not_supported = {"conda" : {"supported" : False }}
54- conda_supported = {"conda" : {"supported" : True }}
55-
56- with self .assertRaises (RSConnectException ) as context :
57- check_server_capabilities (None , (is_conda_supported_on_server ,), lambda x : no_conda )
58- self .assertEqual (
59- str (context .exception ),
60- "Conda is not supported on the target server. " + "Try deploying without requesting Conda." ,
61- )
62-
63- with self .assertRaises (RSConnectException ) as context :
64- check_server_capabilities (None , (is_conda_supported_on_server ,), lambda x : conda_not_supported )
65- self .assertEqual (
66- str (context .exception ),
67- "Conda is not supported on the target server. " + "Try deploying without requesting Conda." ,
68- )
69-
70- check_server_capabilities (None , (is_conda_supported_on_server ,), lambda x : conda_supported )
71-
7236 # noinspection PyUnusedLocal
7337 def fake_cap (details ):
7438 return False
@@ -78,20 +42,6 @@ def fake_cap_with_doc(details):
7842 """A docstring."""
7943 return False
8044
81- with self .assertRaises (RSConnectException ) as context :
82- check_server_capabilities (None , (fake_cap ,), lambda x : None )
83- self .assertEqual (
84- str (context .exception ),
85- "The server does not satisfy the fake_cap capability check." ,
86- )
87-
88- with self .assertRaises (RSConnectException ) as context :
89- check_server_capabilities (None , (fake_cap_with_doc ,), lambda x : None )
90- self .assertEqual (
91- str (context .exception ),
92- "The server does not satisfy the fake_cap_with_doc capability check." ,
93- )
94-
9545 def test_deploy_python_api_validates (self ):
9646 directory = get_api_path ("flask" )
9747 server = RSConnectServer ("https://www.bogus.com" , "bogus" )
0 commit comments