-
Notifications
You must be signed in to change notification settings - Fork 3
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
dee5835
commit e4503a0
Showing
13 changed files
with
60 additions
and
25 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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
.built-image | ||
.DS_Store | ||
__pycache__/ | ||
*.pytest_cache | ||
*.pytest_cache | ||
*venv | ||
*.venv |
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,2 @@ | ||
pytest==8.1.1 | ||
pytest-mock==3.14.0 |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
PyGithub==2.2.0 | ||
PyYAML==6.0.1 | ||
PyYAML==6.0.1 |
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,28 @@ | ||
import pytest | ||
import unittest | ||
from unittest.mock import patch | ||
from main import get_changed_yaml_files_from_pr, get_malformed_yaml_files, main | ||
from github_service import GitHubService as github_service | ||
# python_malformed_yaml_main = importlib.import_module( | ||
# "python-malformed-yaml.main") | ||
# main = python_malformed_yaml_main.main | ||
|
||
def test_get_changed_yaml_files_from_pr(mocker): | ||
# get_github_env_mock = mocker.patch("get_github_env") | ||
# get_github_env_mock.return_value = ("fake_github_token", "fake_repo", "123") | ||
# github_mock = mocker.patch("github") | ||
|
||
get_changed_files_from_pr_mock = mocker.patch("get_changed_files_from_pr") | ||
get_changed_files_from_pr_mock.return_value(["a.yml", "b.py", "c.yaml", "d.txt"]) | ||
assert get_changed_yaml_files_from_pr() == ["a.yml", "c.yaml"] | ||
|
||
|
||
def test_main_exception(): | ||
with pytest.raises(Exception) as exc_info: | ||
main() | ||
expected_malformed_files = [ | ||
"test_python_malformed_yaml/test_yaml_files/bad.yml", | ||
"test_python_malformed_yaml/test_yaml_files/bad.yaml" | ||
] | ||
assert all(file in str(exc_info.value) | ||
for file in expected_malformed_files) |
Empty file.
16 changes: 0 additions & 16 deletions
16
python-malformed-yaml/test/test_python_malformed_yaml/test_main.py
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.