-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more activity types #87
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"id": "b4e50f6c-730a-4ae1-991e-e5231d727c11", | ||
"timestamp": 1665388800273, | ||
"icon": "https://d33mytkkohwnk6.cloudfront.net/app/ActivityFeedIcons/[email protected]", | ||
"action": "rf_unlock", | ||
"deviceID": "102A6A4F31584849971D11807272E7A8", | ||
"deviceType": "lock", | ||
"user": { | ||
"UserID": "83f02a1d-c08a-4c3d-9c30-3b66e185c7bd", | ||
"FirstName": "89", | ||
"LastName": "House" | ||
}, | ||
"title": "<b>89 House</b> unlocked <b>Gate</b> rf_unlock" | ||
} |
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 |
---|---|---|
|
@@ -142,6 +142,8 @@ def test_auto_unlock_activity(self): | |
assert auto_unlock_activity.operated_by == "My Name" | ||
assert auto_unlock_activity.operated_remote is False | ||
assert auto_unlock_activity.operated_keypad is False | ||
assert auto_unlock_activity.operated_manual is False | ||
assert auto_unlock_activity.operated_tag is False | ||
|
||
def test_bluetooth_lock_activity(self): | ||
bluetooth_lock_activity = LockOperationActivity( | ||
|
@@ -150,6 +152,8 @@ def test_bluetooth_lock_activity(self): | |
assert bluetooth_lock_activity.operated_by == "I have a picture" | ||
assert bluetooth_lock_activity.operated_remote is False | ||
assert bluetooth_lock_activity.operated_keypad is False | ||
assert bluetooth_lock_activity.operated_manual is False | ||
assert bluetooth_lock_activity.operated_tag is False | ||
assert bluetooth_lock_activity.operator_image_url == "https://image.url" | ||
assert bluetooth_lock_activity.operator_thumbnail_url == "https://thumbnail.url" | ||
|
||
|
@@ -160,6 +164,8 @@ def test_keypad_lock_activity(self): | |
assert keypad_lock_activity.operated_by == "My Name" | ||
assert keypad_lock_activity.operated_remote is False | ||
assert keypad_lock_activity.operated_keypad is True | ||
assert keypad_lock_activity.operated_manual is False | ||
assert keypad_lock_activity.operated_tag is False | ||
assert keypad_lock_activity.operator_image_url is None | ||
assert keypad_lock_activity.operator_thumbnail_url is None | ||
|
||
|
@@ -170,6 +176,8 @@ def test_auto_lock_activity(self): | |
assert auto_lock_activity.operated_by == "Auto Lock" | ||
assert auto_lock_activity.operated_remote is False | ||
assert auto_lock_activity.operated_keypad is False | ||
assert auto_lock_activity.operated_manual is False | ||
assert auto_lock_activity.operated_tag is False | ||
assert ( | ||
auto_lock_activity.operator_image_url | ||
== "https://d33mytkkohwnk6.cloudfront.net/app/ActivityFeedIcons/[email protected]" | ||
|
@@ -186,6 +194,8 @@ def test_pin_unlock_activity(self): | |
assert keypad_lock_activity.operated_by == "Sample Person" | ||
assert keypad_lock_activity.operated_remote is False | ||
assert keypad_lock_activity.operated_keypad is True | ||
assert keypad_lock_activity.operated_manual is False | ||
assert keypad_lock_activity.operated_tag is False | ||
assert ( | ||
keypad_lock_activity.operator_image_url | ||
== "https://d33mytkkohwnk6.cloudfront.net/app/ActivityFeedIcons/[email protected]" | ||
|
@@ -202,6 +212,8 @@ def test_pin_unlock_activity_with_image(self): | |
assert keypad_lock_activity.operated_by == "Zip Zoo" | ||
assert keypad_lock_activity.operated_remote is False | ||
assert keypad_lock_activity.operated_keypad is True | ||
assert keypad_lock_activity.operated_manual is False | ||
assert keypad_lock_activity.operated_tag is False | ||
assert ( | ||
keypad_lock_activity.operator_image_url | ||
== "https://d33mytkkohwnk6.cloudfront.net/user/abc.jpg" | ||
|
@@ -218,6 +230,8 @@ def test_remote_lock_activity(self): | |
assert remote_lock_activity.operated_by == "My Name" | ||
assert remote_lock_activity.operated_remote is True | ||
assert remote_lock_activity.operated_keypad is False | ||
assert remote_lock_activity.operated_manual is False | ||
assert remote_lock_activity.operated_tag is False | ||
|
||
def test_remote_lock_activity_v4(self): | ||
remote_lock_activity = LockOperationActivity( | ||
|
@@ -226,6 +240,8 @@ def test_remote_lock_activity_v4(self): | |
assert remote_lock_activity.operated_by == "89 House" | ||
assert remote_lock_activity.operated_remote is True | ||
assert remote_lock_activity.operated_keypad is False | ||
assert remote_lock_activity.operated_manual is False | ||
assert remote_lock_activity.operated_tag is False | ||
assert ( | ||
remote_lock_activity.operator_image_url | ||
== "https://d33mytkkohwnk6.cloudfront.net/app/ActivityFeedIcons/[email protected]" | ||
|
@@ -243,6 +259,8 @@ def test_remote_unlock_activity_v4(self): | |
assert remote_unlock_activity.operated_by == "89 House" | ||
assert remote_unlock_activity.operated_remote is True | ||
assert remote_unlock_activity.operated_keypad is False | ||
assert remote_unlock_activity.operated_manual is False | ||
assert remote_unlock_activity.operated_tag is False | ||
assert ( | ||
remote_unlock_activity.operator_image_url | ||
== "https://d33mytkkohwnk6.cloudfront.net/app/ActivityFeedIcons/[email protected]" | ||
|
@@ -260,6 +278,8 @@ def test_remote_unlock_activity_v4_2(self): | |
assert remote_unlock_activity.operated_by == "Zipper Zoomer" | ||
assert remote_unlock_activity.operated_remote is True | ||
assert remote_unlock_activity.operated_keypad is False | ||
assert remote_unlock_activity.operated_manual is False | ||
assert remote_unlock_activity.operated_tag is False | ||
assert ( | ||
remote_unlock_activity.operator_image_url | ||
== "https://d33mytkkohwnk6.cloudfront.net/user/a45daa08-f4b0-4251-aacd-7bf5475851e5.jpg" | ||
|
@@ -276,6 +296,8 @@ def test_manual_lock_activity_v4(self): | |
assert manual_lock_activity.operated_by == "Manual Lock" | ||
assert manual_lock_activity.operated_remote is False | ||
assert manual_lock_activity.operated_keypad is False | ||
assert manual_lock_activity.operated_manual is True | ||
assert manual_lock_activity.operated_tag is False | ||
assert ( | ||
manual_lock_activity.operator_image_url | ||
== "https://d33mytkkohwnk6.cloudfront.net/app/ActivityFeedIcons/[email protected]" | ||
|
@@ -292,6 +314,8 @@ def test_manual_unlock_activity_v4(self): | |
assert manual_unlock_activity.operated_by == "Manual Unlock" | ||
assert manual_unlock_activity.operated_remote is False | ||
assert manual_unlock_activity.operated_keypad is False | ||
assert manual_unlock_activity.operated_manual is True | ||
assert manual_unlock_activity.operated_tag is False | ||
assert ( | ||
manual_unlock_activity.operator_image_url | ||
== "https://d33mytkkohwnk6.cloudfront.net/app/ActivityFeedIcons/[email protected]" | ||
|
@@ -301,6 +325,24 @@ def test_manual_unlock_activity_v4(self): | |
== "https://d33mytkkohwnk6.cloudfront.net/app/ActivityFeedIcons/[email protected]" | ||
) | ||
|
||
def test_rf_unlock_activity_v4(self): | ||
rf_unlock_activity = LockOperationActivity( | ||
SOURCE_LOG, json.loads(load_fixture("rf_unlock_activity_v4.json")) | ||
) | ||
assert rf_unlock_activity.operated_by == "89 House" | ||
assert rf_unlock_activity.operated_remote is False | ||
assert rf_unlock_activity.operated_keypad is False | ||
assert rf_unlock_activity.operated_manual is False | ||
assert rf_unlock_activity.operated_tag is True | ||
assert ( | ||
rf_unlock_activity.operator_image_url | ||
== "https://d33mytkkohwnk6.cloudfront.net/app/ActivityFeedIcons/[email protected]" | ||
) | ||
assert ( | ||
rf_unlock_activity.operator_thumbnail_url | ||
== "https://d33mytkkohwnk6.cloudfront.net/app/ActivityFeedIcons/[email protected]" | ||
) | ||
|
||
def test_lock_activity(self): | ||
lock_operation_activity = LockOperationActivity( | ||
SOURCE_LOG, json.loads(load_fixture("lock_activity.json")) | ||
|
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this is only hitting coverage from the
repr
, we should have an explicit test for both of these to make sure its true when its operated by the knob/tag