Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #205 from Open-Telecoms-Data/2022-11-12-add-tests
actions: Add pytest and first tests
- Loading branch information
Showing
5 changed files
with
77 additions
and
9 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,19 @@ | ||
name: Run all tests | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
architecture: x64 | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
- run: pip install -r requirements.txt | ||
- run: pytest tests |
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 |
---|---|---|
|
@@ -12,4 +12,6 @@ PyGithub | |
ocdskit | ||
sphinx-design | ||
libcoveofds | ||
flattentool | ||
flattentool | ||
pytest | ||
jscc |
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,8 @@ | ||
from jscc.testing.checks import get_invalid_csv_files | ||
from jscc.testing.util import warn_and_assert | ||
|
||
|
||
def test_csv_valid(): | ||
warn_and_assert(get_invalid_csv_files(), '{0} is not valid CSV: {1}', | ||
'CSV files are invalid. See warnings below.') | ||
|
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 @@ | ||
from jscc.testing.checks import get_empty_files, get_misindented_files, get_invalid_json_files | ||
from jscc.testing.util import warn_and_assert | ||
|
||
|
||
def test_empty(): | ||
empty_files_paths = [path for path in get_empty_files() if "src/" not in path[0]] | ||
warn_and_assert(empty_files_paths, "{0} is empty, run: rm {0}", "Files are empty. See warnings below.") | ||
|
||
|
||
def test_invalid_json(): | ||
warn_and_assert( | ||
get_invalid_json_files(excluded=('.git', '.ve', '_static', 'build', 'fixtures', "_build")), "{0} is not valid JSON: {1}", "JSON files are invalid. See warnings below." | ||
) | ||
|