99from databento .live .gateway import Greeting
1010from databento .live .gateway import SessionStart
1111from databento .live .gateway import SubscriptionRequest
12+ from databento .version import __version__
1213from databento_dbn import Encoding
1314from databento_dbn import Schema
1415from databento_dbn import SType
2930 "line, expected" ,
3031 [
3132 pytest .param (
32- "auth=abcd1234|dataset=GLBX.MDP3|encoding=json\n " ,
33- ("abcd1234" , "GLBX.MDP3" , "json" , None , "0" ),
33+ f "auth=abcd1234|dataset=GLBX.MDP3|encoding=json|client=Python { __version__ } \n " ,
34+ ("abcd1234" , "GLBX.MDP3" , "json" , None , "0" , f"Python { __version__ } " ),
3435 ),
3536 pytest .param (
36- "auth=abcd1234|dataset=GLBX.MDP3|ts_out=1\n " ,
37+ f "auth=abcd1234|dataset=GLBX.MDP3|ts_out=1|client=Python { __version__ } \n " ,
3738 (
3839 "abcd1234" ,
3940 "GLBX.MDP3" ,
4041 str (Encoding .DBN ),
4142 None ,
4243 "1" ,
44+ f"Python { __version__ } " ,
4345 ),
4446 ),
4547 pytest .param (
46- "auth=abcd1234|dataset=XNAS.ITCH\n " ,
48+ f "auth=abcd1234|dataset=XNAS.ITCH|client=Python { __version__ } \n " ,
4749 (
4850 "abcd1234" ,
4951 "XNAS.ITCH" ,
5052 str (Encoding .DBN ),
5153 None ,
5254 "0" ,
55+ f"Python { __version__ } " ,
5356 ),
5457 ),
5558 pytest .param (
@@ -73,6 +76,7 @@ def test_parse_authentication_request(
7376 msg .encoding ,
7477 msg .details ,
7578 msg .ts_out ,
79+ msg .client ,
7680 ) == expected
7781 else :
7882 with pytest .raises (expected ):
@@ -87,15 +91,15 @@ def test_parse_authentication_request(
8791 auth = "abcd1234" ,
8892 dataset = Dataset .GLBX_MDP3 ,
8993 ),
90- b "auth=abcd1234|dataset=GLBX.MDP3|encoding=dbn|ts_out=0\n " ,
94+ f "auth=abcd1234|dataset=GLBX.MDP3|encoding=dbn|ts_out=0|client=Python { __version__ } \n ". encode () ,
9195 ),
9296 pytest .param (
9397 AuthenticationRequest (
9498 auth = "abcd1234" ,
9599 dataset = Dataset .XNAS_ITCH ,
96100 ts_out = "1" ,
97101 ),
98- b "auth=abcd1234|dataset=XNAS.ITCH|encoding=dbn|ts_out=1\n " ,
102+ f "auth=abcd1234|dataset=XNAS.ITCH|encoding=dbn|ts_out=1|client=Python { __version__ } \n ". encode () ,
99103 ),
100104 ],
101105)
0 commit comments