Skip to content

Commit af9e048

Browse files
chore: update SDK to v0.9.0
1 parent 28348d6 commit af9e048

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+18570
-15870
lines changed

conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
project = "X API SDK"
2222
copyright = "2024, X Developer Platform"
2323
author = "X Developer Platform"
24-
release = "0.8.1"
25-
version = "0.8.1"
24+
release = "0.9.0"
25+
version = "0.9.0"
2626

2727
# -- General configuration ----------------------------------------------------
2828

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ build-backend = "hatchling.build"
1414

1515
[project]
1616
name = "xdk"
17-
version = "0.8.1"
17+
version = "0.9.0"
1818
description = "Python SDK for the X API"
1919
authors = [
2020
{name = "X Developer Platform", email = "devs@x.com"},

tests/account_activity/test_contracts.py

Lines changed: 194 additions & 194 deletions
Large diffs are not rendered by default.

tests/account_activity/test_structure.py

Lines changed: 75 additions & 75 deletions
Large diffs are not rendered by default.

tests/activity/test_contracts.py

Lines changed: 131 additions & 131 deletions
Large diffs are not rendered by default.

tests/activity/test_structure.py

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,51 @@ def setup_class(self):
4343
self.activity_client = getattr(self.client, "activity")
4444

4545

46+
def test_stream_exists(self):
47+
"""Test that stream method exists with correct signature."""
48+
# Check method exists
49+
method = getattr(ActivityClient, "stream", None)
50+
assert method is not None, f"Method stream does not exist on ActivityClient"
51+
# Check method is callable
52+
assert callable(method), f"stream is not callable"
53+
# Check method signature
54+
sig = inspect.signature(method)
55+
params = list(sig.parameters.keys())
56+
# Should have 'self' as first parameter
57+
assert len(params) >= 1, f"stream should have at least 'self' parameter"
58+
assert (
59+
params[0] == "self"
60+
), f"First parameter should be 'self', got '{params[0]}'"
61+
# Check required parameters exist (excluding 'self')
62+
required_params = []
63+
for required_param in required_params:
64+
assert (
65+
required_param in params
66+
), f"Required parameter '{required_param}' missing from stream"
67+
# Check optional parameters have defaults (excluding 'self')
68+
optional_params = [
69+
"backfill_minutes",
70+
"start_time",
71+
"end_time",
72+
]
73+
for optional_param in optional_params:
74+
if optional_param in params:
75+
param_obj = sig.parameters[optional_param]
76+
assert (
77+
param_obj.default is not inspect.Parameter.empty
78+
), f"Optional parameter '{optional_param}' should have a default value"
79+
80+
81+
def test_stream_return_annotation(self):
82+
"""Test that stream has proper return type annotation."""
83+
method = getattr(ActivityClient, "stream")
84+
sig = inspect.signature(method)
85+
# Check return annotation exists
86+
assert (
87+
sig.return_annotation is not inspect.Signature.empty
88+
), f"Method stream should have return type annotation"
89+
90+
4691
def test_update_subscription_exists(self):
4792
"""Test that update_subscription method exists with correct signature."""
4893
# Check method exists
@@ -137,51 +182,6 @@ def test_delete_subscription_return_annotation(self):
137182
), f"Method delete_subscription should have return type annotation"
138183

139184

140-
def test_stream_exists(self):
141-
"""Test that stream method exists with correct signature."""
142-
# Check method exists
143-
method = getattr(ActivityClient, "stream", None)
144-
assert method is not None, f"Method stream does not exist on ActivityClient"
145-
# Check method is callable
146-
assert callable(method), f"stream is not callable"
147-
# Check method signature
148-
sig = inspect.signature(method)
149-
params = list(sig.parameters.keys())
150-
# Should have 'self' as first parameter
151-
assert len(params) >= 1, f"stream should have at least 'self' parameter"
152-
assert (
153-
params[0] == "self"
154-
), f"First parameter should be 'self', got '{params[0]}'"
155-
# Check required parameters exist (excluding 'self')
156-
required_params = []
157-
for required_param in required_params:
158-
assert (
159-
required_param in params
160-
), f"Required parameter '{required_param}' missing from stream"
161-
# Check optional parameters have defaults (excluding 'self')
162-
optional_params = [
163-
"backfill_minutes",
164-
"start_time",
165-
"end_time",
166-
]
167-
for optional_param in optional_params:
168-
if optional_param in params:
169-
param_obj = sig.parameters[optional_param]
170-
assert (
171-
param_obj.default is not inspect.Parameter.empty
172-
), f"Optional parameter '{optional_param}' should have a default value"
173-
174-
175-
def test_stream_return_annotation(self):
176-
"""Test that stream has proper return type annotation."""
177-
method = getattr(ActivityClient, "stream")
178-
sig = inspect.signature(method)
179-
# Check return annotation exists
180-
assert (
181-
sig.return_annotation is not inspect.Signature.empty
182-
), f"Method stream should have return type annotation"
183-
184-
185185
def test_get_subscriptions_exists(self):
186186
"""Test that get_subscriptions method exists with correct signature."""
187187
# Check method exists
@@ -297,9 +297,9 @@ def test_create_subscription_return_annotation(self):
297297
def test_all_expected_methods_exist(self):
298298
"""Test that all expected methods exist on the client."""
299299
expected_methods = [
300+
"stream",
300301
"update_subscription",
301302
"delete_subscription",
302-
"stream",
303303
"get_subscriptions",
304304
"create_subscription",
305305
]

0 commit comments

Comments
 (0)