Skip to content

Commit 3a6de49

Browse files
authored
Ydev/0.6 patch (#3)
* Register new classes and fix req type. * Match API endpoints. * use singular form. * use singular form.
1 parent 08f9113 commit 3a6de49

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ An application represents a user's application trying to receive webhooks. Once
4444

4545
```python
4646
appData = { "name": "my_app", "support_email": "[email protected]" }
47-
(response, status) = convoy.applications.create({}, appData)
47+
(response, status) = convoy.application.create({}, appData)
4848
app_id = response["data"]["uid"]
4949

5050
```

convoy/api/subscription.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def create(self, query, data):
4646
}
4747
"""
4848

49-
response = self.client.http_get("/subscriptions", query, data)
49+
response = self.client.http_post("/subscriptions", query, data)
5050
return response
5151

5252
def find(self, subscription_id, query):

convoy/convoy.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from convoy.api import application, delivery_attempts, endpoint, event, event_delivery, group
1+
from re import sub
2+
from convoy.api import application, delivery_attempts, endpoint, event, event_delivery, group, source, subscription
23

34
class Convoy():
45
"""Initializes the main Convoy Object.
@@ -19,9 +20,11 @@ class Convoy():
1920
}
2021
"""
2122
def __init__(self, config):
22-
self.applications = application.Application(config)
23-
self.delivery_attempts = delivery_attempts.DeliveryAttempt(config)
23+
self.application = application.Application(config)
24+
self.delivery_attempt = delivery_attempts.DeliveryAttempt(config)
2425
self.endpoint = endpoint.Endpoint(config)
2526
self.event_delivery = event_delivery.EventDelivery(config)
2627
self.event = event.Event(config)
27-
self.group = group.Group(config)
28+
self.group = group.Group(config)
29+
self.source = source.Source(config)
30+
self.subscription = subscription.Subscription(config)

test/test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
def test_application():
1111
NewApplication["name"] = "pythonsdktestapp"
1212
NewApplication["support_email"] = "[email protected]"
13-
_, status = cnv.applications.create({"groupID":"449f4d86-e70b-40eb-a733-dadd89d8d3b6"}, NewApplication)
13+
_, status = cnv.application.create({"groupID":"449f4d86-e70b-40eb-a733-dadd89d8d3b6"}, NewApplication)
1414
assert(status == 201)
1515
# response = cnv.applications.all("groupID=449f4d86-e70b-40eb-a733-dadd89d8d3b6")
1616
# response = cnv.applications.find("fb05c3c7-2d9c-4e07-95b4-e859c1415385", "groupID=449f4d86-e70b-40eb-a733-dadd89d8d3b6")
@@ -95,6 +95,6 @@ def test_group():
9595

9696
#DeliveryAttempts
9797
def test_deliverattempts():
98-
content, status = cnv.deliveryAttempts.all("6bb26fe3-a3d8-4ea8-aa7c-55bd61caa8be", {"groupID":"449f4d86-e70b-40eb-a733-dadd89d8d3b6"})
98+
content, status = cnv.delivery_attempt.all("6bb26fe3-a3d8-4ea8-aa7c-55bd61caa8be", {"groupID":"449f4d86-e70b-40eb-a733-dadd89d8d3b6"})
9999
assert(status == 404)
100100
# response = cnv.deliveryAttempts.find("dfa306bd-ef49-4528-8175-a363e01c4623", "1d1e3b81-3a33-472b-9380-a8c8afa06252", {})

0 commit comments

Comments
 (0)