Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/hub/notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ Access with `norbix.hub.notifications`.
| `save_push_integration` | `POST` | `/{version}/notifications/push/integrations` | `project` |
| `set_push_integration_as_default` | `PUT` | `/{version}/notifications/push/integrations/{Id}/default` | `project` |
| `test_push_integration` | `POST` | `/{version}/notifications/push/integrations/test` | `project` |
| `register_code_mash_app_push_integration` | `POST` | `/{version}/notifications/push/integrations/app/request` | `account` |
| `register_device` | `POST` | `/{version}/notifications/push/devices` | `project` |
| `get_push_disable_dependencies` | `GET` | `/{version}/notifications/push/disable-dependencies` | `project` |
| `get_push_settings` | `GET` | `/{version}/notifications/push/settings` | `project` |
Expand Down
7 changes: 0 additions & 7 deletions docs/hub/push.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,3 @@ owner:
```python
device = client.hub.notifications.get_push_device("pnd_123")
```

## Known gaps

| what | why |
|---|---|
| `check_integration_availability` and the CodeMash-app test call | they point at gateway routes that are commented out, so they are not callable. |
| `get_push_campaign_message` | the gateway route declares an `{id}` token that no request field matches, so the endpoint is unreliable until that is fixed. |
78 changes: 0 additions & 78 deletions src/norbix_python/hub/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -893,19 +893,6 @@ def test_push_integration(self, *, timeout: float | None = None, bearer_token: s
bearer_token=bearer_token,
)

def register_code_mash_app_push_integration(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any:
"""POST /{version}/notifications/push/integrations/app/request"""
return self._transport.send(
target="hub",
path="/{version}/notifications/push/integrations/app/request",
method="POST",
path_params={},
request=request,
scope="account",
timeout=timeout,
bearer_token=bearer_token,
)

def register_device(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any:
"""POST /{version}/notifications/push/devices"""
return self._transport.send(
Expand Down Expand Up @@ -1274,32 +1261,6 @@ def preview_push_notification(self, *, timeout: float | None = None, bearer_toke
bearer_token=bearer_token,
)

def check_integration_availability(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any:
"""POST /{version}/notifications/push/integrations/app/check"""
return self._transport.send(
target="hub",
path="/{version}/notifications/push/integrations/app/check",
method="POST",
path_params={},
request=request,
scope="project",
timeout=timeout,
bearer_token=bearer_token,
)

def test_code_mash_ios_app_integration(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any:
"""POST /{version}/notifications/push/integrations/test/codemash-app"""
return self._transport.send(
target="hub",
path="/{version}/notifications/push/integrations/test/codemash-app",
method="POST",
path_params={},
request=request,
scope="project",
timeout=timeout,
bearer_token=bearer_token,
)

def get_push_settings(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any:
"""GET /{version}/notifications/push/settings"""
return self._transport.send(
Expand Down Expand Up @@ -2631,19 +2592,6 @@ async def test_push_integration(self, *, timeout: float | None = None, bearer_to
bearer_token=bearer_token,
)

async def register_code_mash_app_push_integration(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any:
"""POST /{version}/notifications/push/integrations/app/request"""
return await self._transport.send(
target="hub",
path="/{version}/notifications/push/integrations/app/request",
method="POST",
path_params={},
request=request,
scope="account",
timeout=timeout,
bearer_token=bearer_token,
)

async def register_device(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any:
"""POST /{version}/notifications/push/devices"""
return await self._transport.send(
Expand Down Expand Up @@ -3012,32 +2960,6 @@ async def preview_push_notification(self, *, timeout: float | None = None, beare
bearer_token=bearer_token,
)

async def check_integration_availability(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any:
"""POST /{version}/notifications/push/integrations/app/check"""
return await self._transport.send(
target="hub",
path="/{version}/notifications/push/integrations/app/check",
method="POST",
path_params={},
request=request,
scope="project",
timeout=timeout,
bearer_token=bearer_token,
)

async def test_code_mash_ios_app_integration(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any:
"""POST /{version}/notifications/push/integrations/test/codemash-app"""
return await self._transport.send(
target="hub",
path="/{version}/notifications/push/integrations/test/codemash-app",
method="POST",
path_params={},
request=request,
scope="project",
timeout=timeout,
bearer_token=bearer_token,
)

async def get_push_settings(self, *, timeout: float | None = None, bearer_token: str | None = None, **request: Any) -> Any:
"""GET /{version}/notifications/push/settings"""
return await self._transport.send(
Expand Down
35 changes: 0 additions & 35 deletions tests/hub/test_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def test_hub_notifications_module_surface() -> None:
assert callable(module.save_push_integration)
assert callable(module.set_push_integration_as_default)
assert callable(module.test_push_integration)
assert callable(module.register_code_mash_app_push_integration)
assert callable(module.register_device)


Expand Down Expand Up @@ -539,22 +538,6 @@ def test_hub_notifications_test_push_integration_request_shape() -> None:
assert transport.last_request is not None
assert transport.last_request['url'].startswith('https://')

def test_hub_notifications_register_code_mash_app_push_integration_request_shape() -> None:
client, transport = make_client(account_id='acc-1')
client.hub.notifications.register_code_mash_app_push_integration()
assert transport.last_request['method'] == 'POST'
assert transport.last_request is not None
assert transport.last_request['url'].startswith('https://')

def test_hub_notifications_register_code_mash_app_push_integration_requires_account_scope() -> None:
client = Norbix(project_id='p1', bearer_token='token')
try:
client.hub.notifications.register_code_mash_app_push_integration()
except NorbixError as exc:
assert exc.code == 'NORBIX_ACCOUNT_SCOPE_REQUIRED'
else:
raise AssertionError('Expected account scope error')

def test_hub_notifications_register_device_request_shape() -> None:
client, transport = make_client(account_id=None)
client.hub.notifications.register_device()
Expand Down Expand Up @@ -589,8 +572,6 @@ def test_hub_notifications_new_endpoints_surface() -> None:
assert callable(module.get_push_campaign_batch_notifications)
assert callable(module.get_push_campaign_batch_notification)
assert callable(module.get_push_campaign_statistics)
assert callable(module.check_integration_availability)
assert callable(module.test_code_mash_ios_app_integration)
assert callable(module.get_push_settings)
assert callable(module.get_sms_campaigns)
assert callable(module.create_sms_campaign)
Expand Down Expand Up @@ -811,22 +792,6 @@ def test_hub_notifications_get_push_campaign_statistics_request_shape() -> None:
assert transport.last_request['url'].startswith('https://')


def test_hub_notifications_check_integration_availability_request_shape() -> None:
client, transport = make_client(account_id=None)
client.hub.notifications.check_integration_availability()
assert transport.last_request['method'] == 'POST'
assert transport.last_request is not None
assert transport.last_request['url'].startswith('https://')


def test_hub_notifications_test_code_mash_ios_app_integration_request_shape() -> None:
client, transport = make_client(account_id=None)
client.hub.notifications.test_code_mash_ios_app_integration()
assert transport.last_request['method'] == 'POST'
assert transport.last_request is not None
assert transport.last_request['url'].startswith('https://')


def test_hub_notifications_get_push_settings_request_shape() -> None:
client, transport = make_client(account_id=None)
client.hub.notifications.get_push_settings()
Expand Down
15 changes: 4 additions & 11 deletions tests/hub/test_push.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

The generated test file asserts each push method's verb and that the URL is
https. This file adds the two things it cannot see: the fully-resolved path of
every one of the 39 push routes, and the polymorphic bodies that the server
every one of the 38 push routes, and the polymorphic bodies that the server
routes on.

Only the Fake provider is used for a send path — it is the sandbox that accepts
Expand Down Expand Up @@ -89,12 +89,6 @@
f"{BASE}/integrations/confirm-human-delivery",
lambda m: m.confirm_push_integration_human_delivery(),
),
(
"register_code_mash_app_push_integration",
"POST",
f"{BASE}/integrations/app/request",
lambda m: m.register_code_mash_app_push_integration(),
),
# templates
("get_push_templates", "GET", f"{BASE}/templates", lambda m: m.get_push_templates()),
("create_push_template", "POST", f"{BASE}/templates", lambda m: m.create_push_template()),
Expand Down Expand Up @@ -221,8 +215,7 @@
def test_push_endpoint_hits_the_expected_route(
name: str, verb: str, path: str, call: Callable[[Any], Any]
) -> None:
# register_code_mash_app_push_integration is account-scoped, so the client
# needs an account id; the rest ignore it.
# The client carries an account id; project-scoped routes ignore it.
client, transport = make_client(account_id="acct_1")
call(client.hub.notifications)

Expand All @@ -234,8 +227,8 @@ def test_push_endpoint_hits_the_expected_route(


def test_push_surface_size() -> None:
"""39 live push routes. A new one changes this count, so it cannot arrive untested."""
assert len(PUSH_CASES) == 39
"""38 live push routes. A new one changes this count, so it cannot arrive untested."""
assert len(PUSH_CASES) == 38


def test_push_call_sends_auth_and_project_headers() -> None:
Expand Down
Loading