-
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.
Make some basic test to pass the ci/cd
- Loading branch information
Showing
2 changed files
with
47 additions
and
0 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,8 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
# A Python "namespace package" http://www.python.org/dev/peps/pep-0382/ | ||
# This always goes inside a namespace package's __init__.py | ||
|
||
from pkgutil import extend_path | ||
|
||
__path__ = extend_path(__path__, __name__) |
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,39 @@ | ||
# -*- coding: utf-8 -*- | ||
import os | ||
import pytest | ||
|
||
from pathlib import Path | ||
|
||
|
||
def file_contains_text(file: Path, text: str) -> bool: | ||
return open(file, "r").read().find(text) != -1 | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def script_loc(request): | ||
"""Return the directory of the currently running test script | ||
:param request: | ||
:return: | ||
""" | ||
|
||
return Path(request.fspath).parent.parent | ||
|
||
|
||
def test_cicd(script_loc): | ||
assert file_contains_text( | ||
script_loc.joinpath("Makefile"), "build-and-publish" | ||
), "From the Makefile is missing the build-and-publish command" | ||
|
||
|
||
def test_tox(script_loc): | ||
""" | ||
:param script_loc: | ||
:return: | ||
""" | ||
assert file_contains_text( | ||
script_loc.joinpath(".github/workflows/push_to_main.yml"), | ||
"poetry add tox-gh-actions", | ||
) | ||
assert os.path.isfile(script_loc.joinpath("tox.ini")) |