-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* create event * style: format code with Black and isort This commit fixes the style issues introduced in 39883f8 according to the output from Black and isort. Details: #10 --------- Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
- Loading branch information
1 parent
7fd956b
commit b6a5940
Showing
4 changed files
with
60 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from github.NamedUser import NamedUser | ||
from github.Repository import Repository | ||
|
||
from github_app.Event import Event | ||
from github_app.LazyCompletableGithubObject import LazyCompletableGithubObject | ||
|
||
|
||
class CreateEvent(Event): | ||
"""This class represents a branch or tag creation event.""" | ||
|
||
name = "create" | ||
|
||
def __init__( | ||
self, | ||
description, | ||
master_branch, | ||
pusher_type, | ||
ref, | ||
ref_type, | ||
repository, | ||
sender, | ||
**kwargs, | ||
): | ||
super().__init__(**kwargs) | ||
self.description: str = description | ||
self.master_branch: str = master_branch | ||
self.pusher_type: str = pusher_type | ||
self.ref: str = ref | ||
self.ref_type: str = ref_type | ||
self.repository: Repository = LazyCompletableGithubObject.get_lazy_instance( | ||
Repository, attributes=repository | ||
) | ||
self.sender: NamedUser = LazyCompletableGithubObject.get_lazy_instance( | ||
NamedUser, attributes=sender | ||
) |
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
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,19 @@ | ||
from github_app.CreateEvent import CreateEvent | ||
from tests.factory import event_factory | ||
|
||
|
||
def test_create(): | ||
event = event_factory( | ||
"create", | ||
None, | ||
add_to_body=[ | ||
"description", | ||
"master_branch", | ||
"pusher_type", | ||
"ref", | ||
"ref_type", | ||
"repository", | ||
"sender", | ||
], | ||
) | ||
assert isinstance(event, CreateEvent) |