-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a4f440a
commit 114989c
Showing
8 changed files
with
70 additions
and
18 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
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,13 @@ | ||
import unittest | ||
import requests | ||
|
||
from helpers import Args # helpers are or testing only | ||
from gh import get_repository_dispatch | ||
|
||
|
||
class TestRepoDispatch(unittest.TestCase): | ||
def test_repo_dispatch(self): | ||
self.args = Args() | ||
self.args.is_org = False | ||
assert get_repository_dispatch(args=self.args) == "https://github.com/philipdelorenzo/test-sync-action-status", "The repository dispatch URL is incorrect." | ||
|
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,37 @@ | ||
import unittest | ||
import requests | ||
|
||
from icecream import ic # We will use icecream to print out the job information | ||
from helpers import Args # helpers are or testing only | ||
from gh_api import GithubAPI | ||
|
||
class TestAPI(unittest.TestCase): | ||
args = Args() | ||
|
||
### Let's set debugging on if the flag is past | ||
try: | ||
args.debug | ||
except AttributeError: | ||
args.debug = False | ||
|
||
if args.debug: | ||
ic.enable() | ||
else: | ||
ic.disable() | ||
|
||
def test_action_runs(self): | ||
self.args.is_org = False | ||
self.api = GithubAPI( | ||
token="ghp_1234567890", | ||
api_data="repos/philipdelorenzo/test-sync-action-status" | ||
) | ||
assert isinstance(self.api.repo_actions_url, str), f"This is not a string -- {self.api.repo_actions_url}" | ||
assert self.api.repo_actions_url == "https://api.github.com/repos/philipdelorenzo/test-sync-action-status/actions/runs", f"The action runs URL -- {self.api.repo_actions_data} is incorrect." | ||
|
||
self.args.is_org = True | ||
self.api = GithubAPI( | ||
token="ghp_1234567890", | ||
api_data="orgs/philipdelorenzo/test-sync-action-status" | ||
) | ||
assert isinstance(self.api.repo_actions_url, str), f"This is not a string -- {self.api.repo_actions_url}" | ||
assert self.api.repo_actions_url == "https://api.github.com/orgs/philipdelorenzo/test-sync-action-status/actions/runs", f"The action runs URL -- {self.api.repo_actions_data} is incorrect." |
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