Skip to content

Commit

Permalink
test: Improvements in event tests (box/box-codegen#560) (#300)
Browse files Browse the repository at this point in the history
Co-authored-by: box-sdk-build <[email protected]>
  • Loading branch information
box-sdk-build and box-sdk-build authored Sep 6, 2024
1 parent 8b6ea0b commit 24361c4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .codegen.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "engineHash": "66f851a", "specHash": "6ca858e", "version": "1.4.1" }
{ "engineHash": "edc49a6", "specHash": "6ca858e", "version": "1.4.1" }
22 changes: 11 additions & 11 deletions test/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
def testEvents():
events: Events = client.events.get_events()
assert len(events.entries) > 0
event: Event = events.entries[0]
assert to_string(event.created_by.type) == 'user'
assert not to_string(event.event_type) == ''
first_event: Event = events.entries[0]
assert to_string(first_event.created_by.type) == 'user'
assert not to_string(first_event.event_type) == ''


def testEventUpload():
Expand All @@ -45,9 +45,9 @@ def testEventUpload():
event_type=[GetEventsEventType.UPLOAD.value],
)
assert len(events.entries) > 0
event: Event = events.entries[0]
assert to_string(event.event_type) == 'UPLOAD'
source: EventSource = event.source
first_event: Event = events.entries[0]
assert to_string(first_event.event_type) == 'UPLOAD'
source: EventSource = first_event.source
assert (
to_string(source.item_type) == 'file' or to_string(source.item_type) == 'folder'
)
Expand All @@ -61,9 +61,9 @@ def testEventDeleteUser():
event_type=[GetEventsEventType.DELETE_USER.value],
)
assert len(events.entries) > 0
event: Event = events.entries[0]
assert to_string(event.event_type) == 'DELETE_USER'
source: User = event.source
first_event: Event = events.entries[0]
assert to_string(first_event.event_type) == 'DELETE_USER'
source: User = first_event.source
assert to_string(source.type) == 'user'
assert not source.id == ''

Expand All @@ -73,8 +73,8 @@ def testEventSourceFileOrFolder():
stream_type=GetEventsStreamType.CHANGES.value
)
assert len(events.entries) > 0
event: Event = events.entries[0]
source: File = event.source
first_event: Event = events.entries[0]
source: File = first_event.source
assert to_string(source.type) == 'file' or to_string(source.type) == 'folder'
assert not source.id == ''

Expand Down

0 comments on commit 24361c4

Please sign in to comment.