-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added method to list event log items (#68)
- Loading branch information
Showing
5 changed files
with
68 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from seatsio.domain import EventLogItem | ||
from seatsio.pagination.listableObjectsClient import ListableObjectsClient | ||
|
||
|
||
class EventLogClient(ListableObjectsClient): | ||
|
||
def __init__(self, http_client): | ||
ListableObjectsClient.__init__(self, http_client, EventLogItem, "/event-log") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import time | ||
|
||
from tests.seatsioClientTest import SeatsioClientTest | ||
from tests.util.asserts import assert_that | ||
|
||
|
||
class ListEventLogItems(SeatsioClientTest): | ||
|
||
def test(self): | ||
chart = self.client.charts.create() | ||
self.client.charts.update(chart.key, 'a chart') | ||
|
||
time.sleep(2) | ||
|
||
event_log_items = self.client.event_log.list() | ||
|
||
assert_that(event_log_items).extracting("type").contains_exactly("chart.created", "chart.published") | ||
|
||
def test_properties(self): | ||
chart = self.client.charts.create() | ||
|
||
time.sleep(2) | ||
|
||
event_log_item = self.client.event_log.list().current() | ||
|
||
assert_that(event_log_item.id > 0).is_true() | ||
assert_that(event_log_item.type).is_equal_to("chart.created") | ||
assert_that(event_log_item.workspace_key).is_equal_to(self.workspace.key) | ||
assert_that(event_log_item.date).is_not_none() | ||
assert_that(event_log_item.data).is_equal_to({"key": chart.key}) |