File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -33,10 +33,16 @@ class CodeOcean:
3333 retries : Optional [Retry | int ] = 0
3434 agent_id : Optional [str ] = None
3535
36+ # Minimum server version required by this SDK
37+ MIN_SERVER_VERSION = "3.6.0"
38+
3639 def __post_init__ (self ):
3740 self .session = BaseUrlSession (base_url = f"{ self .domain } /api/v1/" )
3841 self .session .auth = (self .token , "" )
39- self .session .headers .update ({"Content-Type" : "application/json" })
42+ self .session .headers .update ({
43+ "Content-Type" : "application/json" ,
44+ "Min-Server-Version" : CodeOcean .MIN_SERVER_VERSION ,
45+ })
4046 if self .agent_id :
4147 self .session .headers .update ({"Agent-Id" : self .agent_id })
4248 self .session .hooks ["response" ] = [
Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ def test_basic_init(self):
3131 headers = client .session .headers
3232 self .assertIn ("Content-Type" , headers )
3333 self .assertEqual (headers ["Content-Type" ], "application/json" )
34+ self .assertIn ("Min-Server-Version" , headers )
35+ self .assertEqual (headers ["Min-Server-Version" ], CodeOcean .MIN_SERVER_VERSION )
3436
3537 @patch ("codeocean.client.TCPKeepAliveAdapter" )
3638 def test_retry_configuration_types (self , mock_adapter ):
You can’t perform that action at this time.
0 commit comments