-
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
Showing
15 changed files
with
105 additions
and
26 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 |
---|---|---|
|
@@ -11,8 +11,33 @@ on: | |
workflow_dispatch: | ||
|
||
|
||
|
||
|
||
jobs: | ||
lint: | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
python-version: ['3.12'] | ||
os: [ubuntu-latest] | ||
runs-on: ${{matrix.os}} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{matrix.python-version}} | ||
- name: Install Project | ||
run: pip install '.[test]' | ||
- name: Look for style errors | ||
run: pflake8 | ||
- name: Checking for importing style | ||
run: isort --profile=black --check --diff dundie tests integration | ||
- name: Look for auto format errors | ||
run: black --check --diff dundie tests integration | ||
|
||
|
||
tests: | ||
needs: lint | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -27,7 +52,7 @@ jobs: | |
- name: Install Project | ||
run: pip install '.[test]' | ||
- name: Run tests | ||
run: pytest --junitxml=test-result.xml | ||
run: pytest -v --junitxml=test-result.xml | ||
- name: Publish Test Results | ||
uses: EnricoMi/[email protected] | ||
if: always() | ||
|
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
from dundie.cli import main | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Core module of dundie""" | ||
|
||
from dundie.utils.log import get_logger | ||
|
||
log = get_logger() | ||
|
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 |
---|---|---|
@@ -1,24 +1,28 @@ | ||
from subprocess import CalledProcessError, check_output | ||
|
||
import pytest | ||
from subprocess import check_output, CalledProcessError | ||
|
||
|
||
@pytest.mark.integration | ||
@pytest.mark.medium | ||
def test_load_positive_call_load_command(): | ||
"""Test command load""" | ||
out = check_output( | ||
["dundie", "load", "assets/people.csv"] | ||
).decode("utf-8").split("\n") | ||
out = ( | ||
check_output(["dundie", "load", "assets/people.csv"]) | ||
.decode("utf-8") | ||
.split("\n") | ||
) | ||
assert len(out) == 2 | ||
|
||
|
||
@pytest.mark.integration | ||
@pytest.mark.medium | ||
@pytest.mark.parametrize("wrong_command", ["loady", "carrega", "start"]) | ||
def test_load_negative_call_load_command_with_wrong_params(wrong_command): | ||
"""Test command load""" | ||
with pytest.raises(CalledProcessError) as error: | ||
check_output( | ||
["dundie", wrong_command, "assets/people.csv"] | ||
).decode("utf-8").split("\n") | ||
check_output(["dundie", wrong_command, "assets/people.csv"]).decode( | ||
"utf-8" | ||
).split("\n") | ||
|
||
assert "status 2" in str(error.getrepr()) |
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 |
---|---|---|
|
@@ -4,5 +4,11 @@ ipdb | |
pudb | ||
pytest-watch | ||
|
||
# Code Quality | ||
flake8 | ||
pyproject-flake8 | ||
black | ||
isort | ||
|
||
# Install project as editable | ||
-e . |
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 +1,5 @@ | ||
pytest | ||
flake8 | ||
pyproject-flake8 | ||
black | ||
isort |
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 |
---|---|---|
@@ -1 +1 @@ | ||
PEOPLE_FILE = 'tests/assets/people.csv' | ||
PEOPLE_FILE = "tests/assets/people.csv" |
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
Empty file.